1 | <?php |
||
28 | final class InstitutionCollection implements IteratorAggregate, JsonSerializable, SerializableInterface |
||
29 | { |
||
30 | private $elements = []; |
||
31 | |||
32 | public function __construct(array $institutions = []) |
||
38 | |||
39 | public function contains(Institution $institution) |
||
43 | |||
44 | /** |
||
45 | * Adds the institution to this collection |
||
46 | * |
||
47 | * @param Institution $institution |
||
48 | * @throws RuntimeException when the institution already exists in this collection |
||
49 | */ |
||
50 | public function add(Institution $institution) |
||
61 | |||
62 | /** |
||
63 | * Adds all institutions from the given collection to this collection |
||
64 | * |
||
65 | * @param InstitutionCollection $institutionCollection |
||
66 | */ |
||
67 | public function addAllFrom(InstitutionCollection $institutionCollection) |
||
73 | |||
74 | /** |
||
75 | * Removes an institution from this collection |
||
76 | * |
||
77 | * @param Institution $institution |
||
78 | * @throws RuntimeException when the institution to remove is not in this collection |
||
79 | */ |
||
80 | public function remove(Institution $institution) |
||
94 | |||
95 | /** |
||
96 | * Removes all Institutions in the given collection from this collection |
||
97 | * |
||
98 | * @param InstitutionCollection $institutionCollection |
||
99 | */ |
||
100 | public function removeAllIn(InstitutionCollection $institutionCollection) |
||
106 | |||
107 | public function jsonSerialize() |
||
111 | |||
112 | public static function deserialize(array $data) |
||
120 | |||
121 | public function serialize() |
||
127 | |||
128 | public function getIterator() |
||
132 | } |
||
133 |