1 | <?php |
||
23 | final class InstitutionRole implements JsonSerializable |
||
24 | { |
||
25 | const ROLE_USE_RA = 'use_ra'; |
||
26 | const ROLE_USE_RAA = 'use_raa'; |
||
27 | const ROLE_SELECT_RAA = 'select_raa'; |
||
28 | |||
29 | private static $validRoles = [ |
||
30 | self::ROLE_USE_RA, |
||
31 | self::ROLE_USE_RAA, |
||
32 | self::ROLE_SELECT_RAA, |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $type; |
||
39 | |||
40 | /** |
||
41 | * InstitutionRole constructor. |
||
42 | * @param $type |
||
43 | */ |
||
44 | private function __construct($type) |
||
52 | |||
53 | /** |
||
54 | * @param string $type |
||
55 | * @return InstitutionRole |
||
56 | */ |
||
57 | public static function create($type) |
||
61 | |||
62 | /** |
||
63 | * @return InstitutionRole |
||
64 | */ |
||
65 | public static function useRa() |
||
69 | |||
70 | /** |
||
71 | * @return InstitutionRole |
||
72 | */ |
||
73 | public static function useRaa() |
||
77 | |||
78 | /** |
||
79 | * @return InstitutionRole |
||
80 | */ |
||
81 | public static function selectRaa() |
||
85 | |||
86 | /** |
||
87 | * @param InstitutionRole $role |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function equals(InstitutionRole $role) |
||
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getType() |
||
102 | |||
103 | public function jsonSerialize() |
||
107 | |||
108 | /** |
||
109 | * @return string |
||
110 | */ |
||
111 | public function __toString() |
||
115 | |||
116 | } |
||
117 |