1 | <?php |
||
49 | class Item implements ItemInterface |
||
50 | { |
||
51 | /** |
||
52 | * Application item |
||
53 | * |
||
54 | * @var ApplicationItemInterface |
||
55 | */ |
||
56 | protected $item; |
||
57 | |||
58 | /** |
||
59 | * Item constructor |
||
60 | * |
||
61 | * @param ApplicationItemInterface $item Application item |
||
62 | */ |
||
63 | 1 | public function __construct(ApplicationItemInterface $item) |
|
67 | |||
68 | /** |
||
69 | * Return whether the item is of a particular type (or contained in a list of types) |
||
70 | * |
||
71 | * @param array ...$types Item types |
||
72 | * @return boolean Item is contained in the list of types |
||
73 | * @throws InvalidArgumentException If no item type was given |
||
74 | */ |
||
75 | 1 | public function isOfType(...$types) |
|
87 | |||
88 | /** |
||
89 | * Get the values or first value of an item property |
||
90 | * |
||
91 | * Prepend the property name with an "s" to retrieve the list of all available property values. |
||
92 | * |
||
93 | * @param string $name Item property name |
||
94 | * @return string Values or first value of an item property |
||
95 | */ |
||
96 | public function __get($name) |
||
100 | |||
101 | /** |
||
102 | * Get all values or the first value for a particular property (in a property list) |
||
103 | * |
||
104 | * Append the property names with an "s" to retrieve the list of all available property values. |
||
105 | * |
||
106 | * @param array ...$names Property names |
||
107 | * @return string|string[] Property value(s) |
||
108 | * @throws InvalidArgumentException If no property name was given |
||
109 | */ |
||
110 | public function firstOf(...$names) |
||
122 | |||
123 | /** |
||
124 | * Return the first non-NULL value of a property list |
||
125 | * |
||
126 | * @param array $names Property names |
||
127 | * @return string|array|null First existing property name |
||
128 | */ |
||
129 | protected function firstOfPropertyNames(array $names) |
||
141 | |||
142 | protected function getPropertyValueOrValueList($name) |
||
146 | |||
147 | /** |
||
148 | * Return the values of a particular property |
||
149 | * |
||
150 | * @param string $name Property name |
||
151 | * @return array|null Property values |
||
152 | */ |
||
153 | protected function getPropertyValues($name) |
||
161 | } |
||
162 |