src/Entity/ComplaintType.php line 12

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\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\ComplaintTypeRepository")
  8.  */
  9. class ComplaintType
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=200)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @var ArrayCollection
  23.      *
  24.      * @ORM\ManyToMany(targetEntity="App\Entity\EeocFeed", mappedBy="complaintTypes")
  25.      */
  26.     private $eeocFeeds;
  27.     public function __construct()
  28.     {
  29.         $this->eeocFeeds = new ArrayCollection();
  30.     }
  31.     /**
  32.      * @return string
  33.      */
  34.     public function __toString()
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection|EeocFeed[]
  53.      */
  54.     public function getEeocFeeds(): Collection
  55.     {
  56.         return $this->eeocFeeds;
  57.     }
  58.     public function addEeocFeed(EeocFeed $eeocFeed): self
  59.     {
  60.         if (!$this->eeocFeeds->contains($eeocFeed)) {
  61.             $this->eeocFeeds[] = $eeocFeed;
  62.             $eeocFeed->addComplaintType($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeEeocFeed(EeocFeed $eeocFeed): self
  67.     {
  68.         if ($this->eeocFeeds->contains($eeocFeed)) {
  69.             $this->eeocFeeds->removeElement($eeocFeed);
  70.             $eeocFeed->removeComplaintType($this);
  71.         }
  72.         return $this;
  73.     }
  74. }