src/Entity/Gos/ContactSegmentationAction.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  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\ContactSegmentationActionRepository")
  8.  */
  9. class ContactSegmentationAction
  10. {
  11.     /**
  12.     * @ORM\Id
  13.     * @ORM\GeneratedValue
  14.     * @ORM\Column(type="integer")
  15.     */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $action;
  21.     /**
  22.      * @ORM\ManyToMany(targetEntity=ContactSegmentation::class, inversedBy="contactSegmentationActions")
  23.      */
  24.     private $contactSegmentations;
  25.     public function __construct()
  26.     {
  27.         $this->contactSegmentations = new ArrayCollection();
  28.     }
  29.     public function __toString()
  30.     {
  31.         return $this->action;
  32.     }
  33.     /**
  34.      * @return mixed
  35.      */
  36.     public function getId()
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getAction(): ?string
  41.     {
  42.         return $this->action;
  43.     }
  44.     public function setAction($action): void
  45.     {
  46.         $this->action $action;
  47.     }
  48.     /**
  49.      * @return Collection|ContactSegmentation[]
  50.      */
  51.     public function getContactSegmentations(): Collection
  52.     {
  53.         return $this->contactSegmentations;
  54.     }
  55.     public function addContactSegmentation(ContactSegmentation $contactSegmentation): self
  56.     {
  57.         if (!$this->contactSegmentations->contains($contactSegmentation)) {
  58.             $this->contactSegmentations[] = $contactSegmentation;
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeContactSegmentation(ContactSegmentation $contactSegmentation): self
  63.     {
  64.         if ($this->contactSegmentations->contains($contactSegmentation)) {
  65.             $this->contactSegmentations->removeElement($contactSegmentation);
  66.         }
  67.         return $this;
  68.     }
  69. }