1 | <?php |
||
51 | class Iri |
||
52 | { |
||
53 | /** |
||
54 | * Profile |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $immutableProfile; |
||
59 | /** |
||
60 | * Name |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $immutableName; |
||
65 | |||
66 | /** |
||
67 | * Constructor |
||
68 | * |
||
69 | * @param string $profile Profile |
||
70 | * @param string $name Name |
||
71 | */ |
||
72 | 53 | public function __construct($profile, $name) |
|
77 | |||
78 | /** |
||
79 | * Property getter |
||
80 | * |
||
81 | * @param string $name Property name |
||
82 | * |
||
83 | * @return string Property value |
||
84 | * @throws OutOfBoundsException If the requested IRI property is unknown |
||
85 | */ |
||
86 | 53 | public function __get($name) |
|
100 | |||
101 | /** |
||
102 | * Property setter |
||
103 | * |
||
104 | * @param string $name Property name |
||
105 | * @param mixed $value Property value |
||
106 | * |
||
107 | * @throws ErrorException If a property should be set |
||
108 | */ |
||
109 | public function __set($name, $value) |
||
110 | { |
||
111 | throw new ErrorException(ErrorException::IMMUTABLE_IRI_STR, ErrorException::IMMUTABLE_IRI); |
||
112 | } |
||
113 | |||
114 | /** |
||
115 | * Check the existence of a property |
||
116 | * |
||
117 | * @param string $name Property name |
||
118 | * |
||
119 | * @return bool Property exists |
||
120 | */ |
||
121 | 39 | public function __isset($name) |
|
125 | |||
126 | /** |
||
127 | * Serialize the IRI |
||
128 | * |
||
129 | * @return string Serialized IRI |
||
130 | */ |
||
131 | 39 | public function __toString() |
|
135 | } |
||
136 |