@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Catalog\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | * @param string $name Name of the manager |
66 | 66 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
67 | 67 | */ |
68 | - public function createManager( $name ) |
|
68 | + public function createManager($name) |
|
69 | 69 | { |
70 | - return $this->controller->createManager( $name ); |
|
70 | + return $this->controller->createManager($name); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
94 | 94 | * @since 2017.03 |
95 | 95 | */ |
96 | - public function getPath( $id, array $domains = array( 'text', 'media' ) ) |
|
96 | + public function getPath($id, array $domains = array('text', 'media')) |
|
97 | 97 | { |
98 | - return $this->controller->getPath( $id, $domains ); |
|
98 | + return $this->controller->getPath($id, $domains); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
111 | 111 | * @since 2017.03 |
112 | 112 | */ |
113 | - public function getTree( $id = null, array $domains = array( 'text', 'media' ), |
|
114 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ) |
|
113 | + public function getTree($id = null, array $domains = array('text', 'media'), |
|
114 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null) |
|
115 | 115 | { |
116 | - return $this->controller->getTree( $id, $domains, $level, $search ); |
|
116 | + return $this->controller->getTree($id, $domains, $level, $search); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * @since 2015.08 |
126 | 126 | * @deprecated Use createFilter() instead |
127 | 127 | */ |
128 | - public function createCatalogFilter( $default = true ) |
|
128 | + public function createCatalogFilter($default = true) |
|
129 | 129 | { |
130 | - return $this->controller->createCatalogFilter( $default ); |
|
130 | + return $this->controller->createCatalogFilter($default); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | * @since 2015.08 |
142 | 142 | * @deprecated Use getPath() instead |
143 | 143 | */ |
144 | - public function getCatalogPath( $id, array $domains = array( 'text', 'media' ) ) |
|
144 | + public function getCatalogPath($id, array $domains = array('text', 'media')) |
|
145 | 145 | { |
146 | - return $this->controller->getCatalogPath( $id, $domains ); |
|
146 | + return $this->controller->getCatalogPath($id, $domains); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * @since 2015.08 |
160 | 160 | * @deprecated Use getTree() instead |
161 | 161 | */ |
162 | - public function getCatalogTree( $id = null, array $domains = array( 'text', 'media' ), |
|
163 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ) |
|
162 | + public function getCatalogTree($id = null, array $domains = array('text', 'media'), |
|
163 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null) |
|
164 | 164 | { |
165 | - return $this->controller->getCatalogTree( $id, $domains, $level, $search ); |
|
165 | + return $this->controller->getCatalogTree($id, $domains, $level, $search); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | * @since 2015.08 |
176 | 176 | * @deprecated Use product controller instead |
177 | 177 | */ |
178 | - public function aggregateIndex( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
178 | + public function aggregateIndex(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
179 | 179 | { |
180 | - return $this->controller->aggregateIndex( $filter, $key ); |
|
180 | + return $this->controller->aggregateIndex($filter, $key); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | * @since 2015.08 |
191 | 191 | * @deprecated Use product controller instead |
192 | 192 | */ |
193 | - public function addIndexFilterCategory( \Aimeos\MW\Criteria\Iface $search, $catid ) |
|
193 | + public function addIndexFilterCategory(\Aimeos\MW\Criteria\Iface $search, $catid) |
|
194 | 194 | { |
195 | - return $this->controller->addIndexFilterCategory( $search, $catid ); |
|
195 | + return $this->controller->addIndexFilterCategory($search, $catid); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | * @since 2015.08 |
207 | 207 | * @deprecated Use product controller instead |
208 | 208 | */ |
209 | - public function addIndexFilterText( \Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default' ) |
|
209 | + public function addIndexFilterText(\Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default') |
|
210 | 210 | { |
211 | - return $this->controller->addIndexFilterText( $search, $input, $listtype ); |
|
211 | + return $this->controller->addIndexFilterText($search, $input, $listtype); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -224,9 +224,9 @@ discard block |
||
224 | 224 | * @since 2015.08 |
225 | 225 | * @deprecated Use product controller instead |
226 | 226 | */ |
227 | - public function createIndexFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
227 | + public function createIndexFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
228 | 228 | { |
229 | - return $this->controller->createIndexFilter( $sort, $direction, $start, $size, $listtype ); |
|
229 | + return $this->controller->createIndexFilter($sort, $direction, $start, $size, $listtype); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | * @since 2015.08 |
244 | 244 | * @deprecated Use product controller instead |
245 | 245 | */ |
246 | - public function createIndexFilterCategory( $catid, $sort = 'position', $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
246 | + public function createIndexFilterCategory($catid, $sort = 'position', $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
247 | 247 | { |
248 | - return $this->controller->createIndexFilterCategory( $catid, $sort, $direction, $start, $size, $listtype ); |
|
248 | + return $this->controller->createIndexFilterCategory($catid, $sort, $direction, $start, $size, $listtype); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -262,9 +262,9 @@ discard block |
||
262 | 262 | * @since 2015.08 |
263 | 263 | * @deprecated Use product controller instead |
264 | 264 | */ |
265 | - public function createIndexFilterText( $input, $sort = 'relevance', $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
265 | + public function createIndexFilterText($input, $sort = 'relevance', $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
266 | 266 | { |
267 | - return $this->controller->createIndexFilterText( $input, $sort, $direction, $start, $size, $listtype ); |
|
267 | + return $this->controller->createIndexFilterText($input, $sort, $direction, $start, $size, $listtype); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -278,9 +278,9 @@ discard block |
||
278 | 278 | * @since 2015.08 |
279 | 279 | * @deprecated Use product controller instead |
280 | 280 | */ |
281 | - public function getIndexItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
281 | + public function getIndexItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
282 | 282 | { |
283 | - return $this->controller->getIndexItems( $filter, $domains, $total ); |
|
283 | + return $this->controller->getIndexItems($filter, $domains, $total); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | * @since 2015.08 |
294 | 294 | * @deprecated Use product controller instead |
295 | 295 | */ |
296 | - public function getProductItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
296 | + public function getProductItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
297 | 297 | { |
298 | - return $this->controller->getProductItems( $ids, $domains ); |
|
298 | + return $this->controller->getProductItems($ids, $domains); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
313 | 313 | * @deprecated Use product controller instead |
314 | 314 | */ |
315 | - public function createTextFilter( $input, $sort = null, $direction = '-', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ) |
|
315 | + public function createTextFilter($input, $sort = null, $direction = '-', $start = 0, $size = 25, $listtype = 'default', $type = 'name') |
|
316 | 316 | { |
317 | - return $this->controller->createTextFilter( $input, $sort, $direction, $start, $size, $listtype, $type ); |
|
317 | + return $this->controller->createTextFilter($input, $sort, $direction, $start, $size, $listtype, $type); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -325,9 +325,9 @@ discard block |
||
325 | 325 | * @return array Associative list of the product ID as key and the product text as value |
326 | 326 | * @deprecated Use product controller instead |
327 | 327 | */ |
328 | - public function getTextList( \Aimeos\MW\Criteria\Iface $filter ) |
|
328 | + public function getTextList(\Aimeos\MW\Criteria\Iface $filter) |
|
329 | 329 | { |
330 | - return $this->controller->getTextList( $filter ); |
|
330 | + return $this->controller->getTextList($filter); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Service\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
68 | 68 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items |
69 | 69 | */ |
70 | - public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
71 | - $ref = array( 'media', 'price', 'text' ) ) |
|
70 | + public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
71 | + $ref = array('media', 'price', 'text')) |
|
72 | 72 | { |
73 | - return $this->controller->getServices( $type, $basket, $ref ); |
|
73 | + return $this->controller->getServices($type, $basket, $ref); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object |
84 | 84 | * @return array List of attribute definitions implementing \Aimeos\MW\Criteria\Attribute\Iface |
85 | 85 | */ |
86 | - public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
86 | + public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
87 | 87 | { |
88 | - return $this->controller->getServiceAttributes( $type, $serviceId, $basket ); |
|
88 | + return $this->controller->getServiceAttributes($type, $serviceId, $basket); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
101 | 101 | * @throws \Exception If an error occurs |
102 | 102 | */ |
103 | - public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
103 | + public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
104 | 104 | { |
105 | - return $this->controller->getServicePrice( $type, $serviceId, $basket ); |
|
105 | + return $this->controller->getServicePrice($type, $serviceId, $basket); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | * @return array List of key/value pairs of attributes keys and an error message for values that are invalid or |
117 | 117 | * missing |
118 | 118 | */ |
119 | - public function checkServiceAttributes( $type, $serviceId, array $attributes ) |
|
119 | + public function checkServiceAttributes($type, $serviceId, array $attributes) |
|
120 | 120 | { |
121 | - return $this->controller->checkServiceAttributes( $type, $serviceId, $attributes ); |
|
121 | + return $this->controller->checkServiceAttributes($type, $serviceId, $attributes); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Product\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
70 | 70 | * @since 2017.03 |
71 | 71 | */ |
72 | - public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
|
72 | + public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds) |
|
73 | 73 | { |
74 | - return $this->controller->addFilterAttribute( $filter, $attrIds, $optIds, $oneIds ); |
|
74 | + return $this->controller->addFilterAttribute($filter, $attrIds, $optIds, $oneIds); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
88 | 88 | * @since 2017.03 |
89 | 89 | */ |
90 | - public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId, |
|
91 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' ) |
|
90 | + public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId, |
|
91 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default') |
|
92 | 92 | { |
93 | - return $this->controller->addFilterCategory( $filter, $catId, $level, $sort, $direction, $listtype ); |
|
93 | + return $this->controller->addFilterCategory($filter, $catId, $level, $sort, $direction, $listtype); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
106 | 106 | * @since 2017.03 |
107 | 107 | */ |
108 | - public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' ) |
|
108 | + public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default') |
|
109 | 109 | { |
110 | - return $this->controller->addFilterText( $filter, $input, $sort, $direction, $listtype ); |
|
110 | + return $this->controller->addFilterText($filter, $input, $sort, $direction, $listtype); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | * @return array Associative list of key values as key and the product count for this key as value |
120 | 120 | * @since 2015.08 |
121 | 121 | */ |
122 | - public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
122 | + public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
123 | 123 | { |
124 | - return $this->controller->aggregate( $filter, $key ); |
|
124 | + return $this->controller->aggregate($filter, $key); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
137 | 137 | * @since 2015.08 |
138 | 138 | */ |
139 | - public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
139 | + public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
140 | 140 | { |
141 | - return $this->controller->createFilter( $sort, $direction, $start, $size, $listtype ); |
|
141 | + return $this->controller->createFilter($sort, $direction, $start, $size, $listtype); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
151 | 151 | * @since 2017.03 |
152 | 152 | */ |
153 | - public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
|
153 | + public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text')) |
|
154 | 154 | { |
155 | - return $this->controller->getItem( $productId, $domains ); |
|
155 | + return $this->controller->getItem($productId, $domains); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
165 | 165 | * @since 2017.03 |
166 | 166 | */ |
167 | - public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
|
167 | + public function getItems(array $productIds, array $domains = array('media', 'price', 'text')) |
|
168 | 168 | { |
169 | - return $this->controller->getItems( $productIds, $domains ); |
|
169 | + return $this->controller->getItems($productIds, $domains); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
180 | 180 | * @since 2015.08 |
181 | 181 | */ |
182 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
182 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
183 | 183 | { |
184 | - return $this->controller->searchItems( $filter, $domains, $total ); |
|
184 | + return $this->controller->searchItems($filter, $domains, $total); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Stock\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
68 | 68 | * @since 2017.03 |
69 | 69 | */ |
70 | - public function addFilterCodes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
70 | + public function addFilterCodes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
71 | 71 | { |
72 | - return $this->controller->addFilterCodes( $filter, $codes ); |
|
72 | + return $this->controller->addFilterCodes($filter, $codes); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
82 | 82 | * @since 2017.03 |
83 | 83 | */ |
84 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
84 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
85 | 85 | { |
86 | - return $this->controller->addFilterTypes( $filter, $codes ); |
|
86 | + return $this->controller->addFilterTypes($filter, $codes); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * @return \Aimeos\MShop\Stock\Item\Iface Stock item including the referenced domains items |
108 | 108 | * @since 2017.03 |
109 | 109 | */ |
110 | - public function getItem( $id ) |
|
110 | + public function getItem($id) |
|
111 | 111 | { |
112 | - return $this->controller->getItem( $id ); |
|
112 | + return $this->controller->getItem($id); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * @return array Ordered list of stock items implementing \Aimeos\MShop\Stock\Item\Iface |
122 | 122 | * @since 2017.03 |
123 | 123 | */ |
124 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
|
124 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null) |
|
125 | 125 | { |
126 | - return $this->controller->searchItems( $filter, $total ); |
|
126 | + return $this->controller->searchItems($filter, $total); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 |
@@ -16,22 +16,22 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $this->object = new \Aimeos\Controller\Frontend\Product\Standard( \TestHelperFrontend::getContext() ); |
|
19 | + $this->object = new \Aimeos\Controller\Frontend\Product\Standard(\TestHelperFrontend::getContext()); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | |
23 | 23 | protected function tearDown() |
24 | 24 | { |
25 | - unset( $this->object ); |
|
25 | + unset($this->object); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | public function testAggregate() |
30 | 30 | { |
31 | 31 | $filter = $this->object->createFilter(); |
32 | - $list = $this->object->aggregate( $filter, 'index.attribute.id' ); |
|
32 | + $list = $this->object->aggregate($filter, 'index.attribute.id'); |
|
33 | 33 | |
34 | - $this->assertGreaterThan( 0, count( $list ) ); |
|
34 | + $this->assertGreaterThan(0, count($list)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -39,103 +39,103 @@ discard block |
||
39 | 39 | { |
40 | 40 | $filter = $this->object->createFilter(); |
41 | 41 | |
42 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
43 | - $this->assertEquals( array(), $filter->getSortations() ); |
|
44 | - $this->assertEquals( 0, $filter->getSliceStart() ); |
|
45 | - $this->assertEquals( 100, $filter->getSliceSize() ); |
|
42 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
43 | + $this->assertEquals(array(), $filter->getSortations()); |
|
44 | + $this->assertEquals(0, $filter->getSliceStart()); |
|
45 | + $this->assertEquals(100, $filter->getSliceSize()); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testAddFilterAttribute() |
50 | 50 | { |
51 | 51 | $filter = $this->object->createFilter(); |
52 | - $filter = $this->object->addFilterAttribute( $filter, array( 0, 1 ), array(), array() ); |
|
52 | + $filter = $this->object->addFilterAttribute($filter, array(0, 1), array(), array()); |
|
53 | 53 | |
54 | 54 | $list = $filter->getConditions()->getExpressions(); |
55 | 55 | |
56 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
57 | - throw new \RuntimeException( 'Wrong expression' ); |
|
56 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
57 | + throw new \RuntimeException('Wrong expression'); |
|
58 | 58 | } |
59 | 59 | |
60 | - $this->assertEquals( 'index.attributeaggregate([0,1])', $list[0]->getName() ); |
|
61 | - $this->assertEquals( 2, $list[0]->getValue() ); |
|
60 | + $this->assertEquals('index.attributeaggregate([0,1])', $list[0]->getName()); |
|
61 | + $this->assertEquals(2, $list[0]->getValue()); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | public function testAddFilterAttributeOptions() |
66 | 66 | { |
67 | 67 | $filter = $this->object->createFilter(); |
68 | - $filter = $this->object->addFilterAttribute( $filter, array(), array( 1 ), array() ); |
|
68 | + $filter = $this->object->addFilterAttribute($filter, array(), array(1), array()); |
|
69 | 69 | |
70 | 70 | $list = $filter->getConditions()->getExpressions(); |
71 | 71 | |
72 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
73 | - throw new \RuntimeException( 'Wrong expression' ); |
|
72 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
73 | + throw new \RuntimeException('Wrong expression'); |
|
74 | 74 | } |
75 | 75 | |
76 | - $this->assertEquals( 'index.attributeaggregate([1])', $list[0]->getName() ); |
|
77 | - $this->assertEquals( 0, $list[0]->getValue() ); |
|
76 | + $this->assertEquals('index.attributeaggregate([1])', $list[0]->getName()); |
|
77 | + $this->assertEquals(0, $list[0]->getValue()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
81 | 81 | public function testAddFilterAttributeOne() |
82 | 82 | { |
83 | 83 | $filter = $this->object->createFilter(); |
84 | - $filter = $this->object->addFilterAttribute( $filter, array(), array(), array( 'test' => array( 2 ) ) ); |
|
84 | + $filter = $this->object->addFilterAttribute($filter, array(), array(), array('test' => array(2))); |
|
85 | 85 | |
86 | 86 | $list = $filter->getConditions()->getExpressions(); |
87 | 87 | |
88 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
89 | - throw new \RuntimeException( 'Wrong expression' ); |
|
88 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
89 | + throw new \RuntimeException('Wrong expression'); |
|
90 | 90 | } |
91 | 91 | |
92 | - $this->assertEquals( 'index.attributeaggregate([2])', $list[0]->getName() ); |
|
93 | - $this->assertEquals( 0, $list[0]->getValue() ); |
|
92 | + $this->assertEquals('index.attributeaggregate([2])', $list[0]->getName()); |
|
93 | + $this->assertEquals(0, $list[0]->getValue()); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
97 | 97 | public function testAddFilterCategory() |
98 | 98 | { |
99 | 99 | $context = \TestHelperFrontend::getContext(); |
100 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog' ); |
|
100 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'catalog'); |
|
101 | 101 | |
102 | - $catId = $manager->findItem( 'root' )->getId(); |
|
102 | + $catId = $manager->findItem('root')->getId(); |
|
103 | 103 | $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST; |
104 | 104 | |
105 | 105 | $filter = $this->object->createFilter(); |
106 | - $filter = $this->object->addFilterCategory( $filter, $catId, $level ); |
|
106 | + $filter = $this->object->addFilterCategory($filter, $catId, $level); |
|
107 | 107 | |
108 | 108 | $list = $filter->getConditions()->getExpressions(); |
109 | 109 | |
110 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
111 | - throw new \RuntimeException( 'Wrong expression' ); |
|
110 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
111 | + throw new \RuntimeException('Wrong expression'); |
|
112 | 112 | } |
113 | 113 | |
114 | - $this->assertEquals( 'index.catalog.id', $list[0]->getName() ); |
|
115 | - $this->assertEquals( 3, count( $list[0]->getValue() ) ); |
|
116 | - $this->assertEquals( array(), $filter->getSortations() ); |
|
114 | + $this->assertEquals('index.catalog.id', $list[0]->getName()); |
|
115 | + $this->assertEquals(3, count($list[0]->getValue())); |
|
116 | + $this->assertEquals(array(), $filter->getSortations()); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | 120 | public function testAddFilterText() |
121 | 121 | { |
122 | 122 | $filter = $this->object->createFilter(); |
123 | - $filter = $this->object->addFilterText( $filter, 'Espresso' ); |
|
123 | + $filter = $this->object->addFilterText($filter, 'Espresso'); |
|
124 | 124 | |
125 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
125 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
126 | 126 | |
127 | 127 | $list = $filter->getConditions()->getExpressions(); |
128 | 128 | |
129 | 129 | |
130 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
131 | - throw new \RuntimeException( 'Wrong expression' ); |
|
130 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
131 | + throw new \RuntimeException('Wrong expression'); |
|
132 | 132 | } |
133 | - $this->assertEquals( 'index.text.relevance("default","de","Espresso")', $list[0]->getName() ); |
|
134 | - $this->assertEquals( 0, $list[0]->getValue() ); |
|
133 | + $this->assertEquals('index.text.relevance("default","de","Espresso")', $list[0]->getName()); |
|
134 | + $this->assertEquals(0, $list[0]->getValue()); |
|
135 | 135 | |
136 | - $this->assertEquals( array(), $filter->getSortations() ); |
|
137 | - $this->assertEquals( 0, $filter->getSliceStart() ); |
|
138 | - $this->assertEquals( 100, $filter->getSliceSize() ); |
|
136 | + $this->assertEquals(array(), $filter->getSortations()); |
|
137 | + $this->assertEquals(0, $filter->getSliceStart()); |
|
138 | + $this->assertEquals(100, $filter->getSliceSize()); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -144,160 +144,160 @@ discard block |
||
144 | 144 | $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE; |
145 | 145 | |
146 | 146 | $filter = $this->object->createFilter(); |
147 | - $filter = $this->object->addFilterCategory( $filter, 0, $level, 'relevance', '-', 'test' ); |
|
147 | + $filter = $this->object->addFilterCategory($filter, 0, $level, 'relevance', '-', 'test'); |
|
148 | 148 | |
149 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
149 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
150 | 150 | |
151 | 151 | $sort = $filter->getSortations(); |
152 | - if( ( $item = reset( $sort ) ) === false ) { |
|
153 | - throw new \RuntimeException( 'Sortation not set' ); |
|
152 | + if (($item = reset($sort)) === false) { |
|
153 | + throw new \RuntimeException('Sortation not set'); |
|
154 | 154 | } |
155 | 155 | |
156 | - $this->assertEquals( 'sort:index.catalog.position("test",["0"])', $item->getName() ); |
|
157 | - $this->assertEquals( '-', $item->getOperator() ); |
|
156 | + $this->assertEquals('sort:index.catalog.position("test",["0"])', $item->getName()); |
|
157 | + $this->assertEquals('-', $item->getOperator()); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
161 | 161 | public function testCreateFilterSortRelevanceText() |
162 | 162 | { |
163 | - $filter = $this->object->createFilter( 'relevance', '-', 1, 2, 'test' ); |
|
164 | - $filter = $this->object->addFilterText( $filter, 'Espresso' ); |
|
163 | + $filter = $this->object->createFilter('relevance', '-', 1, 2, 'test'); |
|
164 | + $filter = $this->object->addFilterText($filter, 'Espresso'); |
|
165 | 165 | |
166 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
167 | - $this->assertEquals( array(), $filter->getSortations() ); |
|
168 | - $this->assertEquals( 1, $filter->getSliceStart() ); |
|
169 | - $this->assertEquals( 2, $filter->getSliceSize() ); |
|
166 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
167 | + $this->assertEquals(array(), $filter->getSortations()); |
|
168 | + $this->assertEquals(1, $filter->getSliceStart()); |
|
169 | + $this->assertEquals(2, $filter->getSliceSize()); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testCreateFilterSortCode() |
174 | 174 | { |
175 | - $filter = $this->object->createFilter( 'code' ); |
|
175 | + $filter = $this->object->createFilter('code'); |
|
176 | 176 | |
177 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
177 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
178 | 178 | |
179 | 179 | $sort = $filter->getSortations(); |
180 | - if( ( $item = reset( $sort ) ) === false ) { |
|
181 | - throw new \RuntimeException( 'Sortation not set' ); |
|
180 | + if (($item = reset($sort)) === false) { |
|
181 | + throw new \RuntimeException('Sortation not set'); |
|
182 | 182 | } |
183 | 183 | |
184 | - $this->assertEquals( 'product.code', $item->getName() ); |
|
184 | + $this->assertEquals('product.code', $item->getName()); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
188 | 188 | public function testCreateFilterSortName() |
189 | 189 | { |
190 | - $filter = $this->object->createFilter( 'name' ); |
|
190 | + $filter = $this->object->createFilter('name'); |
|
191 | 191 | |
192 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
192 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
193 | 193 | |
194 | 194 | $sort = $filter->getSortations(); |
195 | - if( ( $item = reset( $sort ) ) === false ) { |
|
196 | - throw new \RuntimeException( 'Sortation not set' ); |
|
195 | + if (($item = reset($sort)) === false) { |
|
196 | + throw new \RuntimeException('Sortation not set'); |
|
197 | 197 | } |
198 | 198 | |
199 | - $this->assertEquals( 'sort:index.text.value("default","de","name")', $item->getName() ); |
|
199 | + $this->assertEquals('sort:index.text.value("default","de","name")', $item->getName()); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
203 | 203 | public function testCreateFilterSortPrice() |
204 | 204 | { |
205 | - $filter = $this->object->createFilter( 'price' ); |
|
205 | + $filter = $this->object->createFilter('price'); |
|
206 | 206 | |
207 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
207 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
208 | 208 | |
209 | 209 | $sort = $filter->getSortations(); |
210 | - if( ( $item = reset( $sort ) ) === false ) { |
|
211 | - throw new \RuntimeException( 'Sortation not set' ); |
|
210 | + if (($item = reset($sort)) === false) { |
|
211 | + throw new \RuntimeException('Sortation not set'); |
|
212 | 212 | } |
213 | 213 | |
214 | - $this->assertStringStartsWith( 'sort:index.price.value("default","EUR","default")', $item->getName() ); |
|
214 | + $this->assertStringStartsWith('sort:index.price.value("default","EUR","default")', $item->getName()); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
218 | 218 | public function testCreateFilterSortInvalid() |
219 | 219 | { |
220 | - $filter = $this->object->createFilter( '', 'failure' ); |
|
220 | + $filter = $this->object->createFilter('', 'failure'); |
|
221 | 221 | |
222 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
223 | - $this->assertEquals( array(), $filter->getSortations() ); |
|
222 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
223 | + $this->assertEquals(array(), $filter->getSortations()); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
227 | 227 | public function testGetItem() |
228 | 228 | { |
229 | 229 | $context = \TestHelperFrontend::getContext(); |
230 | - $id = \Aimeos\MShop\Factory::createManager( $context, 'product' )->findItem( 'CNC' )->getId(); |
|
230 | + $id = \Aimeos\MShop\Factory::createManager($context, 'product')->findItem('CNC')->getId(); |
|
231 | 231 | |
232 | - $result = $this->object->getItem( $id ); |
|
232 | + $result = $this->object->getItem($id); |
|
233 | 233 | |
234 | - $this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $result ); |
|
235 | - $this->assertGreaterThan( 0, $result->getPropertyItems() ); |
|
236 | - $this->assertGreaterThan( 0, $result->getRefItems( 'attribute' ) ); |
|
237 | - $this->assertGreaterThan( 0, $result->getRefItems( 'media' ) ); |
|
238 | - $this->assertGreaterThan( 0, $result->getRefItems( 'price' ) ); |
|
239 | - $this->assertGreaterThan( 0, $result->getRefItems( 'product' ) ); |
|
240 | - $this->assertGreaterThan( 0, $result->getRefItems( 'text' ) ); |
|
234 | + $this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $result); |
|
235 | + $this->assertGreaterThan(0, $result->getPropertyItems()); |
|
236 | + $this->assertGreaterThan(0, $result->getRefItems('attribute')); |
|
237 | + $this->assertGreaterThan(0, $result->getRefItems('media')); |
|
238 | + $this->assertGreaterThan(0, $result->getRefItems('price')); |
|
239 | + $this->assertGreaterThan(0, $result->getRefItems('product')); |
|
240 | + $this->assertGreaterThan(0, $result->getRefItems('text')); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | |
244 | 244 | public function testGetItems() |
245 | 245 | { |
246 | 246 | $context = \TestHelperFrontend::getContext(); |
247 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'product' ); |
|
247 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'product'); |
|
248 | 248 | |
249 | 249 | $search = $manager->createSearch(); |
250 | - $search->setConditions( $search->compare( '==', 'product.code', array( 'CNC', 'CNE' ) ) ); |
|
250 | + $search->setConditions($search->compare('==', 'product.code', array('CNC', 'CNE'))); |
|
251 | 251 | |
252 | 252 | $ids = array(); |
253 | - foreach( $manager->searchItems( $search ) as $productItem ) { |
|
253 | + foreach ($manager->searchItems($search) as $productItem) { |
|
254 | 254 | $ids[] = $productItem->getId(); |
255 | 255 | } |
256 | 256 | |
257 | 257 | |
258 | - $result = $this->object->getItems( $ids ); |
|
258 | + $result = $this->object->getItems($ids); |
|
259 | 259 | |
260 | - $this->assertEquals( 2, count( $result ) ); |
|
260 | + $this->assertEquals(2, count($result)); |
|
261 | 261 | |
262 | - foreach( $result as $productItem ) { |
|
263 | - $this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $productItem ); |
|
262 | + foreach ($result as $productItem) { |
|
263 | + $this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $productItem); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
267 | 267 | |
268 | 268 | public function testSearchItemsCategory() |
269 | 269 | { |
270 | - $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( \TestHelperFrontend::getContext() ); |
|
270 | + $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager(\TestHelperFrontend::getContext()); |
|
271 | 271 | $search = $catalogManager->createSearch(); |
272 | 272 | |
273 | - $search->setConditions( $search->compare( '==', 'catalog.code', 'new' ) ); |
|
274 | - $search->setSlice( 0, 1 ); |
|
275 | - $items = $catalogManager->searchItems( $search ); |
|
273 | + $search->setConditions($search->compare('==', 'catalog.code', 'new')); |
|
274 | + $search->setSlice(0, 1); |
|
275 | + $items = $catalogManager->searchItems($search); |
|
276 | 276 | |
277 | - if( ( $item = reset( $items ) ) === false ) { |
|
278 | - throw new \RuntimeException( 'Product item not found' ); |
|
277 | + if (($item = reset($items)) === false) { |
|
278 | + throw new \RuntimeException('Product item not found'); |
|
279 | 279 | } |
280 | 280 | |
281 | - $filter = $this->object->createFilter( 'position', '+', 1, 1 ); |
|
282 | - $filter = $this->object->addFilterCategory( $filter, $item->getId() ); |
|
281 | + $filter = $this->object->createFilter('position', '+', 1, 1); |
|
282 | + $filter = $this->object->addFilterCategory($filter, $item->getId()); |
|
283 | 283 | |
284 | 284 | $total = 0; |
285 | - $results = $this->object->searchItems( $filter, array(), $total ); |
|
285 | + $results = $this->object->searchItems($filter, array(), $total); |
|
286 | 286 | |
287 | - $this->assertEquals( 3, $total ); |
|
288 | - $this->assertEquals( 1, count( $results ) ); |
|
287 | + $this->assertEquals(3, $total); |
|
288 | + $this->assertEquals(1, count($results)); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | |
292 | 292 | public function testSearchItemsText() |
293 | 293 | { |
294 | - $filter = $this->object->createFilter( 'relevance', '+', 0, 1, 'unittype13' ); |
|
295 | - $filter = $this->object->addFilterText( $filter, 'Expresso', 'relevance', '+', 'unittype13' ); |
|
294 | + $filter = $this->object->createFilter('relevance', '+', 0, 1, 'unittype13'); |
|
295 | + $filter = $this->object->addFilterText($filter, 'Expresso', 'relevance', '+', 'unittype13'); |
|
296 | 296 | |
297 | 297 | $total = 0; |
298 | - $results = $this->object->searchItems( $filter, array(), $total ); |
|
298 | + $results = $this->object->searchItems($filter, array(), $total); |
|
299 | 299 | |
300 | - $this->assertEquals( 2, $total ); |
|
301 | - $this->assertEquals( 1, count( $results ) ); |
|
300 | + $this->assertEquals(2, $total); |
|
301 | + $this->assertEquals(1, count($results)); |
|
302 | 302 | } |
303 | 303 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
28 | 28 | * @since 2017.03 |
29 | 29 | */ |
30 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ); |
|
30 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
48 | 48 | * @since 2017.03 |
49 | 49 | */ |
50 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ); |
|
50 | + public function getItem($id, array $domains = array('media', 'price', 'text')); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute item including the referenced domains items |
59 | 59 | * @since 2017.03 |
60 | 60 | */ |
61 | - public function getItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ); |
|
61 | + public function getItems(array $ids, array $domains = array('media', 'price', 'text')); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | /** |
@@ -70,5 +70,5 @@ discard block |
||
70 | 70 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
71 | 71 | * @since 2017.03 |
72 | 72 | */ |
73 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ); |
|
73 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null); |
|
74 | 74 | } |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
30 | 30 | * @since 2017.03 |
31 | 31 | */ |
32 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
32 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
33 | 33 | { |
34 | - if( !empty( $codes ) ) |
|
34 | + if (!empty($codes)) |
|
35 | 35 | { |
36 | 36 | $expr = [ |
37 | - $filter->compare( '==', 'attribute.type.code', $codes ), |
|
37 | + $filter->compare('==', 'attribute.type.code', $codes), |
|
38 | 38 | $filter->getConditions(), |
39 | 39 | ]; |
40 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
40 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return $filter; |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function createFilter() |
55 | 55 | { |
56 | - $filter = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->createSearch( true ); |
|
56 | + $filter = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->createSearch(true); |
|
57 | 57 | |
58 | 58 | $expr = array( |
59 | - $filter->compare( '==', 'attribute.domain', 'product' ), |
|
59 | + $filter->compare('==', 'attribute.domain', 'product'), |
|
60 | 60 | $filter->getConditions(), |
61 | 61 | ); |
62 | 62 | |
63 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
64 | - $filter->setSortations( array( $filter->sort( '+', 'attribute.position' ) ) ); |
|
63 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
64 | + $filter->setSortations(array($filter->sort('+', 'attribute.position'))); |
|
65 | 65 | |
66 | 66 | return $filter; |
67 | 67 | } |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
76 | 76 | * @since 2017.03 |
77 | 77 | */ |
78 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ) |
|
78 | + public function getItem($id, array $domains = array('media', 'price', 'text')) |
|
79 | 79 | { |
80 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->getItem( $id, $domains ); |
|
80 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->getItem($id, $domains); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute item including the referenced domains items |
90 | 90 | * @since 2017.03 |
91 | 91 | */ |
92 | - public function getItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
92 | + public function getItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
93 | 93 | { |
94 | 94 | $filter = $this->createFilter(); |
95 | 95 | $expr = [ |
96 | - $filter->compare( '==', 'attribute.id', $ids ), |
|
96 | + $filter->compare('==', 'attribute.id', $ids), |
|
97 | 97 | $filter->getConditions(), |
98 | 98 | ]; |
99 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
99 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
100 | 100 | |
101 | - return $this->searchItems( $filter, $domains ); |
|
101 | + return $this->searchItems($filter, $domains); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
112 | 112 | * @since 2017.03 |
113 | 113 | */ |
114 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
114 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
115 | 115 | { |
116 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->searchItems( $filter, $domains, $total ); |
|
116 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->searchItems($filter, $domains, $total); |
|
117 | 117 | } |
118 | 118 | } |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Attribute\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
68 | 68 | * @since 2017.03 |
69 | 69 | */ |
70 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
70 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
71 | 71 | { |
72 | - return $this->controller->addFilterTypes( $filter, $codes ); |
|
72 | + return $this->controller->addFilterTypes($filter, $codes); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
95 | 95 | * @since 2017.03 |
96 | 96 | */ |
97 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ) |
|
97 | + public function getItem($id, array $domains = array('media', 'price', 'text')) |
|
98 | 98 | { |
99 | - return $this->controller->getItem( $id, $domains ); |
|
99 | + return $this->controller->getItem($id, $domains); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute item including the referenced domains items |
109 | 109 | * @since 2017.03 |
110 | 110 | */ |
111 | - public function getItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
111 | + public function getItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
112 | 112 | { |
113 | - return $this->controller->getItems( $ids, $domains ); |
|
113 | + return $this->controller->getItems($ids, $domains); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
124 | 124 | * @since 2017.03 |
125 | 125 | */ |
126 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
126 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
127 | 127 | { |
128 | - return $this->controller->searchItems( $filter, $domains, $total ); |
|
128 | + return $this->controller->searchItems($filter, $domains, $total); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $this->object = new \Aimeos\Controller\Frontend\Attribute\Standard( \TestHelperFrontend::getContext() ); |
|
19 | + $this->object = new \Aimeos\Controller\Frontend\Attribute\Standard(\TestHelperFrontend::getContext()); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | |
23 | 23 | protected function tearDown() |
24 | 24 | { |
25 | - unset( $this->object ); |
|
25 | + unset($this->object); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -30,57 +30,57 @@ discard block |
||
30 | 30 | { |
31 | 31 | $filter = $this->object->createFilter(); |
32 | 32 | |
33 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
34 | - $this->assertEquals( 1, count( $filter->getSortations() ) ); |
|
35 | - $this->assertEquals( 0, $filter->getSliceStart() ); |
|
36 | - $this->assertEquals( 100, $filter->getSliceSize() ); |
|
33 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
34 | + $this->assertEquals(1, count($filter->getSortations())); |
|
35 | + $this->assertEquals(0, $filter->getSliceStart()); |
|
36 | + $this->assertEquals(100, $filter->getSliceSize()); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testAddFilterTypes() |
41 | 41 | { |
42 | 42 | $filter = $this->object->createFilter(); |
43 | - $filter = $this->object->addFilterTypes( $filter, ['size'] ); |
|
43 | + $filter = $this->object->addFilterTypes($filter, ['size']); |
|
44 | 44 | |
45 | 45 | $list = $filter->getConditions()->getExpressions(); |
46 | 46 | |
47 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
48 | - throw new \RuntimeException( 'Wrong expression' ); |
|
47 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
48 | + throw new \RuntimeException('Wrong expression'); |
|
49 | 49 | } |
50 | 50 | |
51 | - $this->assertEquals( 'attribute.type.code', $list[0]->getName() ); |
|
52 | - $this->assertEquals( 1, count( $list[0]->getValue() ) ); |
|
51 | + $this->assertEquals('attribute.type.code', $list[0]->getName()); |
|
52 | + $this->assertEquals(1, count($list[0]->getValue())); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testGetItem() |
57 | 57 | { |
58 | 58 | $context = \TestHelperFrontend::getContext(); |
59 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' ); |
|
60 | - $id = $manager->findItem( 'xs', [], 'product', 'size' )->getId(); |
|
59 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'attribute'); |
|
60 | + $id = $manager->findItem('xs', [], 'product', 'size')->getId(); |
|
61 | 61 | |
62 | - $result = $this->object->getItem( $id, ['text'] ); |
|
62 | + $result = $this->object->getItem($id, ['text']); |
|
63 | 63 | |
64 | - $this->assertInstanceOf( '\Aimeos\MShop\Attribute\Item\Iface', $result ); |
|
65 | - $this->assertEquals( 3, count( $result->getRefItems( 'text' ) ) ); |
|
64 | + $this->assertInstanceOf('\Aimeos\MShop\Attribute\Item\Iface', $result); |
|
65 | + $this->assertEquals(3, count($result->getRefItems('text'))); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | public function testGetItems() |
70 | 70 | { |
71 | 71 | $context = \TestHelperFrontend::getContext(); |
72 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' ); |
|
73 | - $id = $manager->findItem( 'xs', [], 'product', 'size' )->getId(); |
|
72 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'attribute'); |
|
73 | + $id = $manager->findItem('xs', [], 'product', 'size')->getId(); |
|
74 | 74 | |
75 | - $result = $this->object->getItems( [$id], ['text'] ); |
|
75 | + $result = $this->object->getItems([$id], ['text']); |
|
76 | 76 | |
77 | - $this->assertInternalType( 'array', $result ); |
|
78 | - $this->assertEquals( 1, count( $result ) ); |
|
77 | + $this->assertInternalType('array', $result); |
|
78 | + $this->assertEquals(1, count($result)); |
|
79 | 79 | |
80 | - foreach( $result as $attrItem ) |
|
80 | + foreach ($result as $attrItem) |
|
81 | 81 | { |
82 | - $this->assertInstanceOf( '\Aimeos\MShop\Attribute\Item\Iface', $attrItem ); |
|
83 | - $this->assertEquals( 3, count( $attrItem->getRefItems( 'text' ) ) ); |
|
82 | + $this->assertInstanceOf('\Aimeos\MShop\Attribute\Item\Iface', $attrItem); |
|
83 | + $this->assertEquals(3, count($attrItem->getRefItems('text'))); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | public function testSearchItems() |
89 | 89 | { |
90 | 90 | $filter = $this->object->createFilter(); |
91 | - $filter = $this->object->addFilterTypes( $filter, ['size'] ); |
|
91 | + $filter = $this->object->addFilterTypes($filter, ['size']); |
|
92 | 92 | |
93 | 93 | $total = 0; |
94 | - $results = $this->object->searchItems( $filter, ['text'], $total ); |
|
94 | + $results = $this->object->searchItems($filter, ['text'], $total); |
|
95 | 95 | |
96 | - $this->assertEquals( 6, $total ); |
|
97 | - $this->assertEquals( 6, count( $results ) ); |
|
96 | + $this->assertEquals(6, $total); |
|
97 | + $this->assertEquals(6, count($results)); |
|
98 | 98 | } |
99 | 99 | } |