| @@ 19-54 (lines=36) @@ | ||
| 16 | /** |
|
| 17 | * Model Applications. |
|
| 18 | */ |
|
| 19 | class Applications extends ArrayCollection implements FromArrayInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @param Application $application |
|
| 23 | * |
|
| 24 | * @return $this |
|
| 25 | */ |
|
| 26 | public function addApplication(Application $application) |
|
| 27 | { |
|
| 28 | $this->add($application); |
|
| 29 | ||
| 30 | return $this; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @param Application $application |
|
| 35 | */ |
|
| 36 | public function removeApplication(Application $application) |
|
| 37 | { |
|
| 38 | $this->removeElement($application); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | public static function fromArray(array $data) |
|
| 45 | { |
|
| 46 | $applications = []; |
|
| 47 | ||
| 48 | foreach ($data as $datum) { |
|
| 49 | $applications[] = Application::fromArray($datum); |
|
| 50 | } |
|
| 51 | ||
| 52 | return new static($applications); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 19-54 (lines=36) @@ | ||
| 16 | /** |
|
| 17 | * Model Events. |
|
| 18 | */ |
|
| 19 | class Events extends ArrayCollection implements FromArrayInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @param Event $event |
|
| 23 | * |
|
| 24 | * @return $this |
|
| 25 | */ |
|
| 26 | public function addEvent(Event $event) |
|
| 27 | { |
|
| 28 | $this->add($event); |
|
| 29 | ||
| 30 | return $this; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @param Event $event |
|
| 35 | */ |
|
| 36 | public function removeEvent(Event $event) |
|
| 37 | { |
|
| 38 | $this->removeElement($event); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | public static function fromArray(array $data) |
|
| 45 | { |
|
| 46 | $events = []; |
|
| 47 | ||
| 48 | foreach ($data as $datum) { |
|
| 49 | $events[] = Event::fromArray($datum); |
|
| 50 | } |
|
| 51 | ||
| 52 | return new static($events); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||