src/Entity/Radio.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RadioRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=RadioRepository::class)
  10.  */
  11. class Radio
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     #[Assert\NotNull(message'Le lien de streaming est obligatoire.')]
  23.     private $streamLink;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     #[Assert\NotNull(message'Le titre est obligatoire.')]
  28.     private $title;
  29.     /**
  30.      * @ORM\Column(type="boolean")
  31.      */
  32.     private $isPublic;
  33.     /**
  34.      * @ORM\ManyToMany(targetEntity=Roles::class)
  35.      */
  36.     private $roles;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=true)
  39.      */
  40.     private $hasAllCriteria1;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true)
  43.      */
  44.     private $hasAllCriteria2;
  45.     /**
  46.      * @ORM\Column(type="boolean", nullable=true)
  47.      */
  48.     private $hasAllCriteria3;
  49.     /**
  50.      * @ORM\Column(type="boolean", nullable=true)
  51.      */
  52.     private $hasAllCriteria4;
  53.     /**
  54.      * @ORM\Column(type="boolean", nullable=true)
  55.      */
  56.     private $hasAllCriteria5;
  57.     /**
  58.      * @ORM\ManyToMany(targetEntity=Criteria1Item::class)
  59.      */
  60.     private $criteria1Items;
  61.     /**
  62.      * @ORM\ManyToMany(targetEntity=Criteria2Item::class)
  63.      */
  64.     private $criteria2Items;
  65.     /**
  66.      * @ORM\ManyToMany(targetEntity=Criteria3Item::class)
  67.      */
  68.     private $criteria3Items;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity=Criteria4Item::class)
  71.      */
  72.     private $criteria4Items;
  73.     /**
  74.      * @ORM\ManyToMany(targetEntity=Criteria5Item::class)
  75.      */
  76.     private $criteria5Items;
  77.     /**
  78.      * @ORM\ManyToMany(targetEntity=Instance::class, inversedBy="radios")
  79.      */
  80.     #[Assert\NotNull(message'L’organisation est obligatoire.')]
  81.     private Collection $instances;
  82.     public function __construct()
  83.     {
  84.         $this->roles = new ArrayCollection();
  85.         $this->criteria1Items = new ArrayCollection();
  86.         $this->criteria2Items = new ArrayCollection();
  87.         $this->criteria3Items = new ArrayCollection();
  88.         $this->criteria4Items = new ArrayCollection();
  89.         $this->criteria5Items = new ArrayCollection();
  90.         $this->instances = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getStreamLink(): ?string
  97.     {
  98.         return $this->streamLink;
  99.     }
  100.     public function setStreamLink(?string $streamLink): self
  101.     {
  102.         $this->streamLink $streamLink;
  103.         return $this;
  104.     }
  105.     public function getTitle(): ?string
  106.     {
  107.         return $this->title;
  108.     }
  109.     public function setTitle(?string $title): self
  110.     {
  111.         $this->title $title;
  112.         return $this;
  113.     }
  114.     public function getIsPublic(): ?bool
  115.     {
  116.         return $this->isPublic;
  117.     }
  118.     public function setIsPublic(bool $isPublic): self
  119.     {
  120.         $this->isPublic $isPublic;
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, Roles>
  125.      */
  126.     public function getRoles(): Collection
  127.     {
  128.         return $this->roles;
  129.     }
  130.     public function addRole(Roles $role): self
  131.     {
  132.         if (!$this->roles->contains($role)) {
  133.             $this->roles[] = $role;
  134.         }
  135.         return $this;
  136.     }
  137.     public function hasAllCriteria1(): ?bool
  138.     {
  139.         return $this->hasAllCriteria1;
  140.     }
  141.     public function setHasAllCriteria1(?bool $hasAllCriteria1): self
  142.     {
  143.         $this->hasAllCriteria1 $hasAllCriteria1;
  144.         return $this;
  145.     }
  146.     public function hasAllCriteria2(): ?bool
  147.     {
  148.         return $this->hasAllCriteria2;
  149.     }
  150.     public function setHasAllCriteria2(?bool $hasAllCriteria2): self
  151.     {
  152.         $this->hasAllCriteria2 $hasAllCriteria2;
  153.         return $this;
  154.     }
  155.     public function hasAllCriteria3(): ?bool
  156.     {
  157.         return $this->hasAllCriteria3;
  158.     }
  159.     public function hasAllCriteria4(): ?bool
  160.     {
  161.         return $this->hasAllCriteria4;
  162.     }
  163.     public function hasAllCriteria5(): ?bool
  164.     {
  165.         return $this->hasAllCriteria5;
  166.     }
  167.     public function setHasAllCriteria3(?bool $hasAllCriteria3): self
  168.     {
  169.         $this->hasAllCriteria3 $hasAllCriteria3;
  170.         return $this;
  171.     }
  172.     public function setHasAllCriteria4(?bool $hasAllCriteria4): self
  173.     {
  174.         $this->hasAllCriteria4 $hasAllCriteria4;
  175.         return $this;
  176.     }
  177.     public function setHasAllCriteria5(?bool $hasAllCriteria5): self
  178.     {
  179.         $this->hasAllCriteria5 $hasAllCriteria5;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return Collection<int, Criteria1Item>
  184.      */
  185.     public function getCriteria1Items(): Collection
  186.     {
  187.         return $this->criteria1Items;
  188.     }
  189.     public function addCriteria1Item(Criteria1Item $criteria1Item): self
  190.     {
  191.         if (!$this->criteria1Items->contains($criteria1Item)) {
  192.             $this->criteria1Items[] = $criteria1Item;
  193.         }
  194.         return $this;
  195.     }
  196.     /**
  197.      * @return Collection<int, Criteria2Item>
  198.      */
  199.     public function getCriteria2Items(): Collection
  200.     {
  201.         return $this->criteria2Items;
  202.     }
  203.     public function addCriteria2Item(Criteria2Item $criteria2Item): self
  204.     {
  205.         if (!$this->criteria2Items->contains($criteria2Item)) {
  206.             $this->criteria2Items[] = $criteria2Item;
  207.         }
  208.         return $this;
  209.     }
  210.     /**
  211.      * @return Collection<int, Criteria3Item>
  212.      */
  213.     public function getCriteria3Items(): Collection
  214.     {
  215.         return $this->criteria3Items;
  216.     }
  217.     public function addCriteria3Item(Criteria3Item $criteria3Item): self
  218.     {
  219.         if (!$this->criteria3Items->contains($criteria3Item)) {
  220.             $this->criteria3Items[] = $criteria3Item;
  221.         }
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection<int, Criteria4Item>
  226.      */
  227.     public function getCriteria4Items(): Collection
  228.     {
  229.         return $this->criteria4Items;
  230.     }
  231.     public function addCriteria4Item(Criteria4Item $criteria4Item): self
  232.     {
  233.         if (!$this->criteria4Items->contains($criteria4Item)) {
  234.             $this->criteria4Items[] = $criteria4Item;
  235.         }
  236.         return $this;
  237.     }
  238.     /**
  239.      * @return Collection<int, Criteria5Item>
  240.      */
  241.     public function getCriteria5Items(): Collection
  242.     {
  243.         return $this->criteria5Items;
  244.     }
  245.     public function addCriteria5Item(Criteria5Item $criteria5Item): self
  246.     {
  247.         if (!$this->criteria5Items->contains($criteria5Item)) {
  248.             $this->criteria5Items[] = $criteria5Item;
  249.         }
  250.         return $this;
  251.     }
  252.     /**
  253.      * @return Collection<int, Instance>
  254.      */
  255.     public function getInstances(): Collection
  256.     {
  257.         return $this->instances;
  258.     }
  259.     public function addInstance(Instance $instance): self
  260.     {
  261.         if (!$this->instances->contains($instance)) {
  262.             $this->instances[] = $instance;
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeInstance(Instance $instance): self
  267.     {
  268.         $this->instances->removeElement($instance);
  269.         return $this;
  270.     }
  271.     public function getInstancesList(): string
  272.     {
  273.         return implode(', '$this->instances->toArray());
  274.     }
  275. }