src/Entity/TipoAccion.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\TipoAccionRepository")
  10.  * @ORM\Table(name="tipo_accion", schema="perseo")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class TipoAccion
  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\AccionAbstract", mappedBy="tipoAccion")
  45.      */
  46.     private $acciones;
  47.     public function __construct()
  48.     {
  49.         $this->acciones = new ArrayCollection();
  50.     }
  51.     public function getId(): ?string
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getNombre(): ?string
  56.     {
  57.         return $this->nombre;
  58.     }
  59.     public function setNombre(?string $nombre): self
  60.     {
  61.         $this->nombre $nombre;
  62.         return $this;
  63.     }
  64.     public function getDescripcion(): ?string
  65.     {
  66.         return $this->descripcion;
  67.     }
  68.     public function setDescripcion(?string $descripcion): self
  69.     {
  70.         $this->descripcion $descripcion;
  71.         return $this;
  72.     }
  73.     public function getDeletedAt(): ?\DateTimeInterface
  74.     {
  75.         return $this->deletedAt;
  76.     }
  77.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  78.     {
  79.         $this->deletedAt $deletedAt;
  80.         return $this;
  81.     }
  82.     public function getUpdatedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->updatedAt;
  85.     }
  86.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  87.     {
  88.         $this->updatedAt $updatedAt;
  89.         return $this;
  90.     }
  91.     public function getCreatedAt(): ?\DateTimeInterface
  92.     {
  93.         return $this->createdAt;
  94.     }
  95.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  96.     {
  97.         $this->createdAt $createdAt;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection<int, AccionAbstract>
  102.      */
  103.     public function getAcciones(): Collection
  104.     {
  105.         return $this->acciones;
  106.     }
  107.     public function addAccione(AccionAbstract $accione): self
  108.     {
  109.         if (!$this->acciones->contains($accione)) {
  110.             $this->acciones->add($accione);
  111.             $accione->setTipoAccion($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeAccione(AccionAbstract $accione): self
  116.     {
  117.         if ($this->acciones->removeElement($accione)) {
  118.             // set the owning side to null (unless already changed)
  119.             if ($accione->getTipoAccion() === $this) {
  120.                 $accione->setTipoAccion(null);
  121.             }
  122.         }
  123.         return $this;
  124.     }
  125. }