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