1 | <?php |
||
50 | class Item implements ItemInterface |
||
51 | { |
||
52 | /** |
||
53 | * Application item |
||
54 | * |
||
55 | * @var ApplicationItemInterface |
||
56 | */ |
||
57 | protected $item; |
||
58 | |||
59 | /** |
||
60 | * Item constructor |
||
61 | * |
||
62 | * @param ApplicationItemInterface $item Application item |
||
63 | */ |
||
64 | 2 | public function __construct(ApplicationItemInterface $item) |
|
68 | |||
69 | /** |
||
70 | * Return whether the item is of a particular type (or contained in a list of types) |
||
71 | * |
||
72 | * @param string $name Name |
||
73 | * @param string|null $profile Profile |
||
74 | * @return boolean Item type is contained in the list of types |
||
75 | */ |
||
76 | 1 | public function isOfType($name, $profile = null) |
|
96 | |||
97 | /** |
||
98 | * Get the values or first value of an item property |
||
99 | * |
||
100 | * Prepend the property name with an "s" to retrieve the list of all available property values. |
||
101 | * |
||
102 | * @param string $name Item property name |
||
103 | * @return string Values or first value of an item property |
||
104 | */ |
||
105 | public function __get($name) |
||
109 | |||
110 | /** |
||
111 | * Get all values or the first value for a particular property (in a property list) |
||
112 | * |
||
113 | * Append the property names with an "s" to retrieve the list of all available property values. |
||
114 | * |
||
115 | * @param array ...$names Property names |
||
116 | * @return string|string[] Property value(s) |
||
117 | * @throws InvalidArgumentException If no property name was given |
||
118 | */ |
||
119 | public function firstOf(...$names) |
||
131 | |||
132 | /** |
||
133 | * Return the first non-NULL value of a property list |
||
134 | * |
||
135 | * @param array $names Property names |
||
136 | * @return string|array|null First existing property name |
||
137 | */ |
||
138 | protected function firstOfPropertyNames(array $names) |
||
150 | |||
151 | protected function getPropertyValueOrValueList($name) |
||
155 | |||
156 | /** |
||
157 | * Return the values of a particular property |
||
158 | * |
||
159 | * @param string $name Property name |
||
160 | * @return array|null Property values |
||
161 | */ |
||
162 | protected function getPropertyValues($name) |
||
170 | } |
||
171 |