<?php
/**
* User: deniger
* Date: 21/03/2018
* Time: 13:29
*/
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* EventGroupContactsOnSite
*
* @ORM\Table(name="event_group_contacts_onsite")
* @ORM\Entity
*/
class EventGroupContactsOnSite extends EventGroupContactsMapped
{
/**
*
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="App\Entity\EventContact", mappedBy="groupContactsOnSite",cascade={"all"})
* @ORM\OrderBy({"firstName" = "ASC"})
*/
private $contacts;
public function __construct()
{
$this->contacts = new ArrayCollection();
}
/**
* @return ArrayCollection
*/
public function getContacts(): Collection
{
return $this->contacts;
}
/**
* @param Collection $contacts
*/
public function setContacts(Collection $contacts): void
{
$this->contacts = $contacts;
}
public function addContact(EventContact $contact)
{
$this->contacts[] = $contact;
$contact->setGroupContactsOnSite($this);
}
}