<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * NOTE: it will better to use AssociationOverrides stuff but not possible in doctrine v 1.5 * To be used for EventGroupContacts * * @ORM\MappedSuperclass */abstract class EventGroupContactsMapped{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ public $id; /** * FROM NEOS (code) * * @var string * @ORM\Column(name="code",type="string", length=50,nullable=true) */ private $code; /** * FROM NEOS (name) * * @var string * @ORM\Column(name="name",type="string", length=128,nullable=true) */ private $name; /** * FROM NEOS * * @var string * @ORM\Column(name="text", type="text",nullable=true) */ private $information; /** * @return mixed */ public function getCode(): ?string { return $this->code; } /** * @param mixed $code */ public function setCode($code) { $this->code = $code; } /** * @return int */ public function getId() { return $this->id; } public function toString(): string { return $this->getName() . " {id=" . $this->id . "}"; } /** * @return mixed */ public function getName(): ?string { return $this->name; } /** * @param mixed $name */ public function setName($name) { $this->name = $name; } /** * @return string */ public function getInformation(): ?string { return $this->information; } /** * @param string $information */ public function setInformation(string $information = null): void { $this->information = $information; } public function getActiveContacts() { $res = []; $contacts = $this->getContacts(); /** * @var EventContact $contact */ foreach ($contacts as $contact) { if (EntityInterface::STATUS_ACTIVE == $contact->getStatus()) { $res[] = $contact; } } return $res; } /** * @return ArrayCollection */ abstract public function getContacts(): Collection; /** * @param Collection $contacts */ abstract public function setContacts(Collection $contacts); abstract public function addContact(EventContact $contact);}