1 | <?php |
||
23 | final class InstitutionAuthorizationOption implements JsonSerializable |
||
24 | { |
||
25 | /** |
||
26 | * @var InstitutionRole |
||
27 | */ |
||
28 | private $institutionRole; |
||
29 | |||
30 | /** |
||
31 | * @var InstitutionSet |
||
32 | */ |
||
33 | private $institutionSet; |
||
34 | |||
35 | /** |
||
36 | * @var boolean |
||
37 | */ |
||
38 | private $isDefault; |
||
39 | |||
40 | /** |
||
41 | * If the default is set to true then the object will use the old default behaviour. That behaviour is that it |
||
42 | * will take the current institution into account when returning institutions. |
||
43 | * |
||
44 | * AbstractRoleOption constructor. |
||
45 | * @param InstitutionRole $role |
||
46 | * @param InstitutionSet $institutionSet |
||
47 | * @param bool $isDefault |
||
48 | */ |
||
49 | private function __construct(InstitutionRole $role, InstitutionSet $institutionSet, $isDefault) |
||
55 | |||
56 | /** |
||
57 | * @param InstitutionRole $role |
||
58 | * @param string[]|null |
||
59 | * @return InstitutionAuthorizationOption |
||
60 | */ |
||
61 | public static function fromInstitutionConfig(InstitutionRole $role, $institutions = null) |
||
97 | |||
98 | /** |
||
99 | * @param InstitutionRole $role |
||
100 | * @param Institution $institution |
||
101 | * @param Institution[] $institutions |
||
102 | * @return InstitutionAuthorizationOption |
||
103 | */ |
||
104 | public static function fromInstitutions(InstitutionRole $role, Institution $institution, array $institutions) |
||
111 | |||
112 | /** |
||
113 | * @param InstitutionRole $role |
||
114 | * @param string[]|null |
||
115 | * @return InstitutionAuthorizationOption |
||
116 | */ |
||
117 | public static function getDefault(InstitutionRole $role) |
||
121 | |||
122 | /** |
||
123 | * @param InstitutionRole $role |
||
124 | * @param string[]|null |
||
125 | * @return InstitutionAuthorizationOption |
||
126 | */ |
||
127 | public static function getEmpty(InstitutionRole $role) |
||
131 | |||
132 | /** |
||
133 | * @return null |
||
134 | */ |
||
135 | public static function blank() |
||
139 | |||
140 | /** |
||
141 | * @param InstitutionAuthorizationOption $option |
||
142 | * @return bool |
||
143 | */ |
||
144 | public function equals(InstitutionAuthorizationOption $option) |
||
151 | |||
152 | /** |
||
153 | * @return InstitutionRole |
||
154 | */ |
||
155 | public function getInstitutionRole() |
||
159 | |||
160 | /** |
||
161 | * @return InstitutionSet |
||
162 | */ |
||
163 | public function getInstitutionSet() |
||
167 | |||
168 | /** |
||
169 | * If the default is set to true then the object will use the old default behaviour. That behaviour is that it |
||
170 | * will take the current institution into account and this method will return the current institution. |
||
171 | * |
||
172 | * @param Institution $institution |
||
173 | * @return Institution[] |
||
174 | */ |
||
175 | public function getInstitutions(Institution $institution) |
||
182 | |||
183 | /** |
||
184 | * @return bool |
||
185 | */ |
||
186 | public function isDefault() |
||
190 | |||
191 | public function jsonSerialize() |
||
198 | } |
||
199 |