1 | <?php |
||
21 | class Standard |
||
22 | extends \Aimeos\MShop\Common\Item\Base |
||
|
|||
23 | implements \Aimeos\MShop\Locale\Item\Site\Iface |
||
24 | { |
||
25 | private $children; |
||
26 | private $values; |
||
27 | |||
28 | /** |
||
29 | * Initializes the site object. |
||
30 | * |
||
31 | * @param array $values Associative list of item key/value pairs |
||
32 | * @param array $children List of nodes implementing \Aimeos\MW\Tree\Node\Iface |
||
33 | */ |
||
34 | public function __construct( array $values = [], array $children = [] ) |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Returns the id of the site. |
||
46 | * |
||
47 | * @return integer|null Id of the site |
||
48 | */ |
||
49 | public function getSiteId() |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Returns the code of the site. |
||
57 | * |
||
58 | * @return string Returns the code of the item |
||
59 | */ |
||
60 | public function getCode() |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Sets the code of the site. |
||
72 | * |
||
73 | * @param string $code The code to set |
||
74 | * @return \Aimeos\MShop\Locale\Item\Site\Iface Locale site item for chaining method calls |
||
75 | */ |
||
76 | public function setCode( $code ) |
||
86 | |||
87 | |||
88 | /** |
||
89 | * Returns the config property of the site. |
||
90 | * |
||
91 | * @return array Returns the config of the Site |
||
92 | */ |
||
93 | public function getConfig() |
||
101 | |||
102 | |||
103 | /** |
||
104 | * Sets the config property of the site. |
||
105 | * |
||
106 | * @param array $options Options to be set for the Site |
||
107 | * @return \Aimeos\MShop\Locale\Item\Site\Iface Locale site item for chaining method calls |
||
108 | */ |
||
109 | public function setConfig( array $options ) |
||
116 | |||
117 | |||
118 | /** |
||
119 | * Returns the label property of the site. |
||
120 | * |
||
121 | * @return string Returns the label of the Site |
||
122 | */ |
||
123 | public function getLabel() |
||
131 | |||
132 | |||
133 | /** |
||
134 | * Sets the label property of the site. |
||
135 | * |
||
136 | * @param string $label The label of the Site |
||
137 | * @return \Aimeos\MShop\Locale\Item\Site\Iface Locale site item for chaining method calls |
||
138 | */ |
||
139 | public function setLabel( $label ) |
||
149 | |||
150 | |||
151 | /** |
||
152 | * Returns the level of the item in the tree |
||
153 | * |
||
154 | * @return integer Level of the item starting with "0" for the root node |
||
155 | */ |
||
156 | public function getLevel() |
||
160 | |||
161 | |||
162 | /** |
||
163 | * Returns the ID of the parent site |
||
164 | * |
||
165 | * @return string Unique ID of the parent site |
||
166 | */ |
||
167 | public function getParentId() |
||
171 | |||
172 | |||
173 | /** |
||
174 | * Returns the status property of the Site. |
||
175 | * |
||
176 | * @return integer Returns the status of the Site |
||
177 | */ |
||
178 | public function getStatus() |
||
186 | |||
187 | |||
188 | /** |
||
189 | * Sets status property. |
||
190 | * |
||
191 | * @param integer $status The status of the Site |
||
192 | * @return \Aimeos\MShop\Locale\Item\Site\Iface Locale site item for chaining method calls |
||
193 | */ |
||
194 | public function setStatus( $status ) |
||
204 | |||
205 | |||
206 | /** |
||
207 | * Returns the item type |
||
208 | * |
||
209 | * @return string Item type, subtypes are separated by slashes |
||
210 | */ |
||
211 | public function getResourceType() |
||
215 | |||
216 | |||
217 | /** |
||
218 | * Tests if the item is available based on status, time, language and currency |
||
219 | * |
||
220 | * @return boolean True if available, false if not |
||
221 | */ |
||
222 | public function isAvailable() |
||
226 | |||
227 | |||
228 | /** |
||
229 | * Sets the item values from the given array. |
||
230 | * |
||
231 | * @param array $list Associative list of item keys and their values |
||
232 | * @return array Associative list of keys and their values that are unknown |
||
233 | */ |
||
234 | public function fromArray( array $list ) |
||
253 | |||
254 | |||
255 | /** |
||
256 | * Returns the item values as array. |
||
257 | * |
||
258 | * @param boolean True to return private properties, false for public only |
||
259 | * @return array Associative list of item properties and their values |
||
260 | */ |
||
261 | public function toArray( $private = false ) |
||
279 | |||
280 | |||
281 | /** |
||
282 | * Returns a child of this node identified by its index. |
||
283 | * |
||
284 | * @param integer $index Index of child node |
||
285 | * @return \Aimeos\MShop\Locale\Item\Site\Iface Selected node |
||
286 | */ |
||
287 | public function getChild( $index ) |
||
291 | |||
292 | |||
293 | /** |
||
294 | * Returns all children of this node. |
||
295 | * |
||
296 | * @return array Numerically indexed list of nodes |
||
297 | */ |
||
298 | public function getChildren() |
||
302 | |||
303 | |||
304 | /** |
||
305 | * Tests if a node has children. |
||
306 | * |
||
307 | * @return boolean True if node has children, false if not |
||
308 | */ |
||
309 | public function hasChildren() |
||
313 | |||
314 | |||
315 | /** |
||
316 | * Adds a child node to this node. |
||
317 | * |
||
318 | * @param \Aimeos\MShop\Common\Item\Tree\Iface $item Child node to add |
||
319 | */ |
||
320 | public function addChild( \Aimeos\MShop\Common\Item\Tree\Iface $item ) |
||
323 | } |