src/Entity/EventGroupContactsMapped.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.  * NOTE: it will better to use AssociationOverrides stuff but not possible in doctrine v 1.5
  8.  * To be used for EventGroupContacts
  9.  *
  10.  * @ORM\MappedSuperclass
  11.  */
  12. abstract class EventGroupContactsMapped
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     public $id;
  22.     /**
  23.      * FROM NEOS (code)
  24.      *
  25.      * @var string
  26.      * @ORM\Column(name="code",type="string", length=50,nullable=true)
  27.      */
  28.     private $code;
  29.     /**
  30.      * FROM NEOS (name)
  31.      *
  32.      * @var string
  33.      * @ORM\Column(name="name",type="string", length=128,nullable=true)
  34.      */
  35.     private $name;
  36.     /**
  37.      * FROM NEOS
  38.      *
  39.      * @var string
  40.      * @ORM\Column(name="text", type="text",nullable=true)
  41.      */
  42.     private $information;
  43.     /**
  44.      * @return mixed
  45.      */
  46.     public function getCode(): ?string
  47.     {
  48.         return $this->code;
  49.     }
  50.     /**
  51.      * @param mixed $code
  52.      */
  53.     public function setCode($code)
  54.     {
  55.         $this->code $code;
  56.     }
  57.     /**
  58.      * @return int
  59.      */
  60.     public function getId()
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function toString(): string
  65.     {
  66.         return $this->getName() . " {id=" $this->id "}";
  67.     }
  68.     /**
  69.      * @return mixed
  70.      */
  71.     public function getName(): ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     /**
  76.      * @param mixed $name
  77.      */
  78.     public function setName($name)
  79.     {
  80.         $this->name $name;
  81.     }
  82.     /**
  83.      * @return string
  84.      */
  85.     public function getInformation(): ?string
  86.     {
  87.         return $this->information;
  88.     }
  89.     /**
  90.      * @param string $information
  91.      */
  92.     public function setInformation(string $information null): void
  93.     {
  94.         $this->information $information;
  95.     }
  96.     public function getActiveContacts()
  97.     {
  98.         $res = [];
  99.         $contacts $this->getContacts();
  100.         /**
  101.          * @var EventContact $contact
  102.          */
  103.         foreach ($contacts as $contact) {
  104.             if (EntityInterface::STATUS_ACTIVE == $contact->getStatus()) {
  105.                 $res[] = $contact;
  106.             }
  107.         }
  108.         return $res;
  109.     }
  110.     /**
  111.      * @return ArrayCollection
  112.      */
  113.     abstract public function getContacts(): Collection;
  114.     /**
  115.      * @param Collection $contacts
  116.      */
  117.     abstract public function setContacts(Collection $contacts);
  118.     abstract public function addContact(EventContact $contact);
  119. }