src/Entity/EventGroupContactsOthers.php line 15

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.  * EventGroupContactsOthers
  8.  *
  9.  * @ORM\Table(name="event_group_contacts_others")
  10.  * @ORM\Entity
  11.  */
  12. class EventGroupContactsOthers extends EventGroupContactsMapped
  13. {
  14.     /**
  15.      *
  16.      * @var ArrayCollection
  17.      *
  18.      * @ORM\OneToMany(targetEntity="App\Entity\EventContact",  mappedBy="groupContactsOthers",cascade={"all"})
  19.      * @ORM\OrderBy({"firstName" = "ASC"})
  20.      */
  21.     private $contacts;
  22.     public function __construct()
  23.     {
  24.         $this->contacts = new ArrayCollection();
  25.     }
  26.     /**
  27.      * @return ArrayCollection
  28.      */
  29.     public function getContacts(): Collection
  30.     {
  31.         return $this->contacts;
  32.     }
  33.     /**
  34.      * @param Collection $contacts
  35.      */
  36.     public function setContacts(Collection $contacts): void
  37.     {
  38.         $this->contacts $contacts;
  39.     }
  40.     public function addContact(EventContact $contact)
  41.     {
  42.         $this->contacts[] = $contact;
  43.         $contact->setGroupContactsOthers($this);
  44.     }
  45. }