src/Entity/Material.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\MaterialRepository")
  10.  * @ORM\Table(name="material")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Material
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="bigint", options={"unsigned":true})
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", nullable=true)
  23.      */
  24.     private $nombre;
  25.     /**
  26.      * @ORM\Column(type="text", nullable=true)
  27.      */
  28.     private $descripcion;
  29.     /**
  30.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  31.      */
  32.     private $deletedAt;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  35.      * @Gedmo\Timestampable(on="update")
  36.      */
  37.     private $updatedAt;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  40.      * @Gedmo\Timestampable(on="create")
  41.      */
  42.     private $createdAt;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="cajaRelojMaterial")
  45.      */
  46.     private $relojesCajaRelojMaterial;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="cajaRelojMaterialBisel")
  49.      */
  50.     private $relojesCajaRelojMaterialBisel;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="pulseraMaterial")
  53.      */
  54.     private $relojesPulseraMaterial;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="pulseraMaterialCierre")
  57.      */
  58.     private $relojesPulseraMaterialCierre;
  59.     public function __construct()
  60.     {
  61.         $this->relojesCajaRelojMaterial = new ArrayCollection();
  62.         $this->relojesCajaRelojMaterialBisel = new ArrayCollection();
  63.         $this->relojesPulseraMaterial = new ArrayCollection();
  64.         $this->relojesPulseraMaterialCierre = new ArrayCollection();
  65.     }
  66.     public function __toString(): string
  67.     {
  68.         return $this->getNombre()??'---';
  69.     }
  70.     public function getId(): ?string
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getNombre(): ?string
  75.     {
  76.         return $this->nombre;
  77.     }
  78.     public function setNombre(?string $nombre): static
  79.     {
  80.         $this->nombre $nombre;
  81.         return $this;
  82.     }
  83.     public function getDescripcion(): ?string
  84.     {
  85.         return $this->descripcion;
  86.     }
  87.     public function setDescripcion(?string $descripcion): static
  88.     {
  89.         $this->descripcion $descripcion;
  90.         return $this;
  91.     }
  92.     public function getDeletedAt(): ?\DateTimeInterface
  93.     {
  94.         return $this->deletedAt;
  95.     }
  96.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  97.     {
  98.         $this->deletedAt $deletedAt;
  99.         return $this;
  100.     }
  101.     public function getUpdatedAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->updatedAt;
  104.     }
  105.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  106.     {
  107.         $this->updatedAt $updatedAt;
  108.         return $this;
  109.     }
  110.     public function getCreatedAt(): ?\DateTimeInterface
  111.     {
  112.         return $this->createdAt;
  113.     }
  114.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  115.     {
  116.         $this->createdAt $createdAt;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, Reloj>
  121.      */
  122.     public function getRelojesCajaRelojMaterial(): Collection
  123.     {
  124.         return $this->relojesCajaRelojMaterial;
  125.     }
  126.     public function addRelojesCajaRelojMaterial(Reloj $relojesCajaRelojMaterial): static
  127.     {
  128.         if (!$this->relojesCajaRelojMaterial->contains($relojesCajaRelojMaterial)) {
  129.             $this->relojesCajaRelojMaterial->add($relojesCajaRelojMaterial);
  130.             $relojesCajaRelojMaterial->setCajaRelojMaterial($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeRelojesCajaRelojMaterial(Reloj $relojesCajaRelojMaterial): static
  135.     {
  136.         if ($this->relojesCajaRelojMaterial->removeElement($relojesCajaRelojMaterial)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($relojesCajaRelojMaterial->getCajaRelojMaterial() === $this) {
  139.                 $relojesCajaRelojMaterial->setCajaRelojMaterial(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, Reloj>
  146.      */
  147.     public function getRelojesCajaRelojMaterialBisel(): Collection
  148.     {
  149.         return $this->relojesCajaRelojMaterialBisel;
  150.     }
  151.     public function addRelojesCajaRelojMaterialBisel(Reloj $relojesCajaRelojMaterialBisel): static
  152.     {
  153.         if (!$this->relojesCajaRelojMaterialBisel->contains($relojesCajaRelojMaterialBisel)) {
  154.             $this->relojesCajaRelojMaterialBisel->add($relojesCajaRelojMaterialBisel);
  155.             $relojesCajaRelojMaterialBisel->setCajaRelojMaterialBisel($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeRelojesCajaRelojMaterialBisel(Reloj $relojesCajaRelojMaterialBisel): static
  160.     {
  161.         if ($this->relojesCajaRelojMaterialBisel->removeElement($relojesCajaRelojMaterialBisel)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($relojesCajaRelojMaterialBisel->getCajaRelojMaterialBisel() === $this) {
  164.                 $relojesCajaRelojMaterialBisel->setCajaRelojMaterialBisel(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return Collection<int, Reloj>
  171.      */
  172.     public function getRelojesPulseraMaterial(): Collection
  173.     {
  174.         return $this->relojesPulseraMaterial;
  175.     }
  176.     public function addRelojesPulseraMaterial(Reloj $relojesPulseraMaterial): static
  177.     {
  178.         if (!$this->relojesPulseraMaterial->contains($relojesPulseraMaterial)) {
  179.             $this->relojesPulseraMaterial->add($relojesPulseraMaterial);
  180.             $relojesPulseraMaterial->setPulseraMaterial($this);
  181.         }
  182.         return $this;
  183.     }
  184.     public function removeRelojesPulseraMaterial(Reloj $relojesPulseraMaterial): static
  185.     {
  186.         if ($this->relojesPulseraMaterial->removeElement($relojesPulseraMaterial)) {
  187.             // set the owning side to null (unless already changed)
  188.             if ($relojesPulseraMaterial->getPulseraMaterial() === $this) {
  189.                 $relojesPulseraMaterial->setPulseraMaterial(null);
  190.             }
  191.         }
  192.         return $this;
  193.     }
  194.     /**
  195.      * @return Collection<int, Reloj>
  196.      */
  197.     public function getRelojesPulseraMaterialCierre(): Collection
  198.     {
  199.         return $this->relojesPulseraMaterialCierre;
  200.     }
  201.     public function addRelojesPulseraMaterialCierre(Reloj $relojesPulseraMaterialCierre): static
  202.     {
  203.         if (!$this->relojesPulseraMaterialCierre->contains($relojesPulseraMaterialCierre)) {
  204.             $this->relojesPulseraMaterialCierre->add($relojesPulseraMaterialCierre);
  205.             $relojesPulseraMaterialCierre->setPulseraMaterialCierre($this);
  206.         }
  207.         return $this;
  208.     }
  209.     public function removeRelojesPulseraMaterialCierre(Reloj $relojesPulseraMaterialCierre): static
  210.     {
  211.         if ($this->relojesPulseraMaterialCierre->removeElement($relojesPulseraMaterialCierre)) {
  212.             // set the owning side to null (unless already changed)
  213.             if ($relojesPulseraMaterialCierre->getPulseraMaterialCierre() === $this) {
  214.                 $relojesPulseraMaterialCierre->setPulseraMaterialCierre(null);
  215.             }
  216.         }
  217.         return $this;
  218.     }
  219. }