src/Entity/Competencia.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\CompetenciaRepository")
  10.  * @ORM\Table(name="competencia", schema="perseo")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Competencia
  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="string", nullable=true)
  27.      */
  28.     private $descripcion;
  29.     /**
  30.      * @ORM\Column(type="smallint", length=2, nullable=true, options={"default":0})
  31.      */
  32.     private $orden;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  35.      */
  36.     private $deletedAt;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  39.      * @Gedmo\Timestampable(on="update")
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  44.      * @Gedmo\Timestampable(on="create")
  45.      */
  46.     private $createdAt;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\AccionCompetencia", mappedBy="competencia")
  49.      */
  50.     private $accionesCompetencia;
  51.     public function __construct()
  52.     {
  53.         $this->accionesCompetencia = new ArrayCollection();
  54.     }
  55.     public function __toString(): string
  56.     {
  57.         return $this->getNombre() ?? '---';
  58.     }
  59.     public function getId(): ?string
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getNombre(): ?string
  64.     {
  65.         return $this->nombre;
  66.     }
  67.     public function setNombre(?string $nombre): self
  68.     {
  69.         $this->nombre $nombre;
  70.         return $this;
  71.     }
  72.     public function getDescripcion(): ?string
  73.     {
  74.         return $this->descripcion;
  75.     }
  76.     public function setDescripcion(?string $descripcion): self
  77.     {
  78.         $this->descripcion $descripcion;
  79.         return $this;
  80.     }
  81.     public function getOrden(): ?int
  82.     {
  83.         return $this->orden;
  84.     }
  85.     public function setOrden(?int $orden): self
  86.     {
  87.         $this->orden $orden;
  88.         return $this;
  89.     }
  90.     public function getDeletedAt(): ?\DateTimeInterface
  91.     {
  92.         return $this->deletedAt;
  93.     }
  94.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  95.     {
  96.         $this->deletedAt $deletedAt;
  97.         return $this;
  98.     }
  99.     public function getUpdatedAt(): ?\DateTimeInterface
  100.     {
  101.         return $this->updatedAt;
  102.     }
  103.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  104.     {
  105.         $this->updatedAt $updatedAt;
  106.         return $this;
  107.     }
  108.     public function getCreatedAt(): ?\DateTimeInterface
  109.     {
  110.         return $this->createdAt;
  111.     }
  112.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  113.     {
  114.         $this->createdAt $createdAt;
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return Collection<int, AccionCompetencia>
  119.      */
  120.     public function getAccionesCompetencia(): Collection
  121.     {
  122.         return $this->accionesCompetencia;
  123.     }
  124.     public function addAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
  125.     {
  126.         if (!$this->accionesCompetencia->contains($accionesCompetencium)) {
  127.             $this->accionesCompetencia->add($accionesCompetencium);
  128.             $accionesCompetencium->setCompetencia($this);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
  133.     {
  134.         if ($this->accionesCompetencia->removeElement($accionesCompetencium)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($accionesCompetencium->getCompetencia() === $this) {
  137.                 $accionesCompetencium->setCompetencia(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142. }