src/Entity/ProgramaType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProgramaTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProgramaTypeRepository::class)
  9.  */
  10. class ProgramaType
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $content;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $slug;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Programa::class, mappedBy="programaType")
  28.      */
  29.     private $programas;
  30.     public function __construct()
  31.     {
  32.         $this->programas = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getContent(): ?string
  39.     {
  40.         return $this->content;
  41.     }
  42.     public function setContent(string $content): self
  43.     {
  44.         $this->content $content;
  45.         return $this;
  46.     }
  47.     public function __toString()
  48.     {
  49.         return $this->content;
  50.     }
  51.     public function getSlug(): ?string
  52.     {
  53.         return $this->slug;
  54.     }
  55.     public function setSlug(?string $slug): self
  56.     {
  57.         $this->slug $slug;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, Programa>
  62.      */
  63.     public function getProgramas(): Collection
  64.     {
  65.         return $this->programas;
  66.     }
  67.     public function addProgramas(Programa $programa): self
  68.     {
  69.         if (!$this->programas->contains($programa)) {
  70.             $this->programas[] = $programa;
  71.             $programa->setSeller($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeProgramas(Programa $programa): self
  76.     {
  77.         if ($this->programas->removeElement($programa)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($programa->getSeller() === $this) {
  80.                 $programa->setSeller(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85. }