@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
30 | 30 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/frontend/basket/name |
35 | 35 | * Class name of the used basket frontend controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2014.03 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'controller/frontend/basket/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('controller/frontend/basket/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Basket\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Basket\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Frontend\\Basket\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Frontend\\Basket\\' . $name; |
79 | 79 | |
80 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
80 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/frontend/basket/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the basket frontend controllers |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @see controller/frontend/basket/decorators/excludes |
154 | 154 | * @see controller/frontend/basket/decorators/global |
155 | 155 | */ |
156 | - return self::addControllerDecorators( $context, $manager, 'basket' ); |
|
156 | + return self::addControllerDecorators($context, $manager, 'basket'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | } |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
30 | 30 | * @since 2015.08 |
31 | 31 | */ |
32 | - public function createManager( $name ) |
|
32 | + public function createManager($name) |
|
33 | 33 | { |
34 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), $name ); |
|
34 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), $name); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | * @return \Aimeos\MW\Criteria\Iface Criteria object for filtering |
43 | 43 | * @since 2015.08 |
44 | 44 | */ |
45 | - public function createCatalogFilter( $default = true ) |
|
45 | + public function createCatalogFilter($default = true) |
|
46 | 46 | { |
47 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->createSearch( $default ); |
|
47 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->createSearch($default); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
57 | 57 | * @since 2015.08 |
58 | 58 | */ |
59 | - public function getCatalogPath( $id, array $domains = array( 'text', 'media' ) ) |
|
59 | + public function getCatalogPath($id, array $domains = array('text', 'media')) |
|
60 | 60 | { |
61 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->getPath( $id, $domains ); |
|
61 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->getPath($id, $domains); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
74 | 74 | * @since 2015.08 |
75 | 75 | */ |
76 | - public function getCatalogTree( $id = null, array $domains = array( 'text', 'media' ), |
|
77 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ) |
|
76 | + public function getCatalogTree($id = null, array $domains = array('text', 'media'), |
|
77 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null) |
|
78 | 78 | { |
79 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->getTree( $id, $domains, $level, $search ); |
|
79 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->getTree($id, $domains, $level, $search); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | * @return array Associative list of key values as key and the product count for this key as value |
89 | 89 | * @since 2015.08 |
90 | 90 | */ |
91 | - public function aggregateIndex( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
91 | + public function aggregateIndex(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
92 | 92 | { |
93 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->aggregate( $filter, $key ); |
|
93 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->aggregate($filter, $key); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -105,46 +105,46 @@ discard block |
||
105 | 105 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
106 | 106 | * @since 2015.08 |
107 | 107 | */ |
108 | - public function createIndexFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
108 | + public function createIndexFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
109 | 109 | { |
110 | 110 | $sortations = array(); |
111 | 111 | $context = $this->getContext(); |
112 | 112 | |
113 | - $search = \Aimeos\MShop\Factory::createManager( $context, 'index' )->createSearch( true ); |
|
114 | - $expr = array( $search->compare( '!=', 'index.catalog.id', null ) ); |
|
113 | + $search = \Aimeos\MShop\Factory::createManager($context, 'index')->createSearch(true); |
|
114 | + $expr = array($search->compare('!=', 'index.catalog.id', null)); |
|
115 | 115 | |
116 | - switch( $sort ) |
|
116 | + switch ($sort) |
|
117 | 117 | { |
118 | 118 | case 'code': |
119 | - $sortations[] = $search->sort( $direction, 'product.code' ); |
|
119 | + $sortations[] = $search->sort($direction, 'product.code'); |
|
120 | 120 | break; |
121 | 121 | |
122 | 122 | case 'name': |
123 | 123 | $langid = $context->getLocale()->getLanguageId(); |
124 | 124 | |
125 | - $cmpfunc = $search->createFunction( 'index.text.value', array( $listtype, $langid, 'name', 'product' ) ); |
|
126 | - $expr[] = $search->compare( '>=', $cmpfunc, '' ); |
|
125 | + $cmpfunc = $search->createFunction('index.text.value', array($listtype, $langid, 'name', 'product')); |
|
126 | + $expr[] = $search->compare('>=', $cmpfunc, ''); |
|
127 | 127 | |
128 | - $sortfunc = $search->createFunction( 'sort:index.text.value', array( $listtype, $langid, 'name' ) ); |
|
129 | - $sortations[] = $search->sort( $direction, $sortfunc ); |
|
128 | + $sortfunc = $search->createFunction('sort:index.text.value', array($listtype, $langid, 'name')); |
|
129 | + $sortations[] = $search->sort($direction, $sortfunc); |
|
130 | 130 | break; |
131 | 131 | |
132 | 132 | case 'price': |
133 | 133 | $currencyid = $context->getLocale()->getCurrencyId(); |
134 | 134 | |
135 | - $cmpfunc = $search->createFunction( 'index.price.value', array( $listtype, $currencyid, 'default' ) ); |
|
136 | - $expr[] = $search->compare( '>=', $cmpfunc, '0.00' ); |
|
135 | + $cmpfunc = $search->createFunction('index.price.value', array($listtype, $currencyid, 'default')); |
|
136 | + $expr[] = $search->compare('>=', $cmpfunc, '0.00'); |
|
137 | 137 | |
138 | - $sortfunc = $search->createFunction( 'sort:index.price.value', array( $listtype, $currencyid, 'default' ) ); |
|
139 | - $sortations[] = $search->sort( $direction, $sortfunc ); |
|
138 | + $sortfunc = $search->createFunction('sort:index.price.value', array($listtype, $currencyid, 'default')); |
|
139 | + $sortations[] = $search->sort($direction, $sortfunc); |
|
140 | 140 | break; |
141 | 141 | } |
142 | 142 | |
143 | 143 | $expr[] = $search->getConditions(); |
144 | 144 | |
145 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
146 | - $search->setSortations( $sortations ); |
|
147 | - $search->setSlice( $start, $size ); |
|
145 | + $search->setConditions($search->combine('&&', $expr)); |
|
146 | + $search->setSortations($sortations); |
|
147 | + $search->setSlice($start, $size); |
|
148 | 148 | |
149 | 149 | return $search; |
150 | 150 | } |
@@ -162,22 +162,22 @@ discard block |
||
162 | 162 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
163 | 163 | * @since 2015.08 |
164 | 164 | */ |
165 | - public function createIndexFilterCategory( $catid, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
165 | + public function createIndexFilterCategory($catid, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
166 | 166 | { |
167 | - $search = $this->createIndexFilter( $sort, $direction, $start, $size, $listtype ); |
|
168 | - $expr = array( $search->compare( '==', 'index.catalog.id', $catid ) ); |
|
167 | + $search = $this->createIndexFilter($sort, $direction, $start, $size, $listtype); |
|
168 | + $expr = array($search->compare('==', 'index.catalog.id', $catid)); |
|
169 | 169 | |
170 | - if( $sort === 'relevance' ) |
|
170 | + if ($sort === 'relevance') |
|
171 | 171 | { |
172 | - $cmpfunc = $search->createFunction( 'index.catalog.position', array( $listtype, $catid ) ); |
|
173 | - $expr[] = $search->compare( '>=', $cmpfunc, 0 ); |
|
172 | + $cmpfunc = $search->createFunction('index.catalog.position', array($listtype, $catid)); |
|
173 | + $expr[] = $search->compare('>=', $cmpfunc, 0); |
|
174 | 174 | |
175 | - $sortfunc = $search->createFunction( 'sort:index.catalog.position', array( $listtype, $catid ) ); |
|
176 | - $search->setSortations( array( $search->sort( $direction, $sortfunc ) ) ); |
|
175 | + $sortfunc = $search->createFunction('sort:index.catalog.position', array($listtype, $catid)); |
|
176 | + $search->setSortations(array($search->sort($direction, $sortfunc))); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $expr[] = $search->getConditions(); |
180 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
180 | + $search->setConditions($search->combine('&&', $expr)); |
|
181 | 181 | |
182 | 182 | return $search; |
183 | 183 | } |
@@ -195,16 +195,16 @@ discard block |
||
195 | 195 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
196 | 196 | * @since 2015.08 |
197 | 197 | */ |
198 | - public function createIndexFilterText( $input, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
198 | + public function createIndexFilterText($input, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
199 | 199 | { |
200 | 200 | $langid = $this->getContext()->getLocale()->getLanguageId(); |
201 | - $search = $this->createIndexFilter( $sort, $direction, $start, $size, $listtype ); |
|
202 | - $expr = array( $search->compare( '>', $search->createFunction( 'index.text.relevance', array( $listtype, $langid, $input ) ), 0 ) ); |
|
201 | + $search = $this->createIndexFilter($sort, $direction, $start, $size, $listtype); |
|
202 | + $expr = array($search->compare('>', $search->createFunction('index.text.relevance', array($listtype, $langid, $input)), 0)); |
|
203 | 203 | |
204 | 204 | // we don't need to sort by 'sort:index.text.relevance' because it's a boolean match (relevance is either 0 or 1) |
205 | 205 | |
206 | 206 | $expr[] = $search->getConditions(); |
207 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
207 | + $search->setConditions($search->combine('&&', $expr)); |
|
208 | 208 | |
209 | 209 | return $search; |
210 | 210 | } |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
219 | 219 | * @since 2015.08 |
220 | 220 | */ |
221 | - public function addIndexFilterCategory( \Aimeos\MW\Criteria\Iface $search, $catid ) |
|
221 | + public function addIndexFilterCategory(\Aimeos\MW\Criteria\Iface $search, $catid) |
|
222 | 222 | { |
223 | - $expr = array( $search->compare( '==', 'index.catalog.id', $catid ) ); |
|
223 | + $expr = array($search->compare('==', 'index.catalog.id', $catid)); |
|
224 | 224 | |
225 | 225 | $expr[] = $search->getConditions(); |
226 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
226 | + $search->setConditions($search->combine('&&', $expr)); |
|
227 | 227 | |
228 | 228 | return $search; |
229 | 229 | } |
@@ -238,13 +238,13 @@ discard block |
||
238 | 238 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
239 | 239 | * @since 2015.08 |
240 | 240 | */ |
241 | - public function addIndexFilterText( \Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default' ) |
|
241 | + public function addIndexFilterText(\Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default') |
|
242 | 242 | { |
243 | 243 | $langid = $this->getContext()->getLocale()->getLanguageId(); |
244 | - $expr = array( $search->compare( '>', $search->createFunction( 'index.text.relevance', array( $listtype, $langid, $input ) ), 0 ) ); |
|
244 | + $expr = array($search->compare('>', $search->createFunction('index.text.relevance', array($listtype, $langid, $input)), 0)); |
|
245 | 245 | |
246 | 246 | $expr[] = $search->getConditions(); |
247 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
247 | + $search->setConditions($search->combine('&&', $expr)); |
|
248 | 248 | |
249 | 249 | return $search; |
250 | 250 | } |
@@ -259,9 +259,9 @@ discard block |
||
259 | 259 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
260 | 260 | * @since 2015.08 |
261 | 261 | */ |
262 | - public function getIndexItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
262 | + public function getIndexItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
263 | 263 | { |
264 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->searchItems( $filter, $domains, $total ); |
|
264 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->searchItems($filter, $domains, $total); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | |
@@ -274,19 +274,19 @@ discard block |
||
274 | 274 | * @throws \Aimeos\Controller\Frontend\Catalog\Exception If product isn't available |
275 | 275 | * @since 2015.08 |
276 | 276 | */ |
277 | - public function getProductItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
277 | + public function getProductItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
278 | 278 | { |
279 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' ); |
|
279 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product'); |
|
280 | 280 | |
281 | - $search = $manager->createSearch( true ); |
|
281 | + $search = $manager->createSearch(true); |
|
282 | 282 | $expr = array( |
283 | - $search->compare( '==', 'product.id', $ids ), |
|
283 | + $search->compare('==', 'product.id', $ids), |
|
284 | 284 | $search->getConditions(), |
285 | 285 | ); |
286 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
287 | - $search->setSlice( 0, count( $ids ) ); |
|
286 | + $search->setConditions($search->combine('&&', $expr)); |
|
287 | + $search->setSlice(0, count($ids)); |
|
288 | 288 | |
289 | - return $manager->searchItems( $search, $domains ); |
|
289 | + return $manager->searchItems($search, $domains); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | |
@@ -302,37 +302,37 @@ discard block |
||
302 | 302 | * @param string $type Type of the text like "name", "short", "long", etc. |
303 | 303 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
304 | 304 | */ |
305 | - public function createTextFilter( $input, $sort = null, $direction = '+', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ) |
|
305 | + public function createTextFilter($input, $sort = null, $direction = '+', $start = 0, $size = 25, $listtype = 'default', $type = 'name') |
|
306 | 306 | { |
307 | 307 | $locale = $this->getContext()->getLocale(); |
308 | 308 | $langid = $locale->getLanguageId(); |
309 | 309 | |
310 | - $search = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index/text' )->createSearch( true ); |
|
310 | + $search = \Aimeos\MShop\Factory::createManager($this->getContext(), 'index/text')->createSearch(true); |
|
311 | 311 | |
312 | 312 | $expr = array( |
313 | - $search->compare( '>', $search->createFunction( 'index.text.relevance', array( $listtype, $langid, $input ) ), 0 ), |
|
314 | - $search->compare( '>', $search->createFunction( 'index.text.value', array( $listtype, $langid, $type, 'product' ) ), '' ), |
|
313 | + $search->compare('>', $search->createFunction('index.text.relevance', array($listtype, $langid, $input)), 0), |
|
314 | + $search->compare('>', $search->createFunction('index.text.value', array($listtype, $langid, $type, 'product')), ''), |
|
315 | 315 | ); |
316 | 316 | |
317 | 317 | $sortations = array(); |
318 | 318 | |
319 | - switch( $sort ) |
|
319 | + switch ($sort) |
|
320 | 320 | { |
321 | 321 | case 'name': |
322 | - $cmpfunc = $search->createFunction( 'index.text.value', array( $listtype, $langid, 'name', 'product' ) ); |
|
323 | - $expr[] = $search->compare( '>=', $cmpfunc, '' ); |
|
322 | + $cmpfunc = $search->createFunction('index.text.value', array($listtype, $langid, 'name', 'product')); |
|
323 | + $expr[] = $search->compare('>=', $cmpfunc, ''); |
|
324 | 324 | |
325 | - $sortfunc = $search->createFunction( 'sort:index.text.value', array( $listtype, $langid, 'name' ) ); |
|
326 | - $sortations[] = $search->sort( $direction, $sortfunc ); |
|
325 | + $sortfunc = $search->createFunction('sort:index.text.value', array($listtype, $langid, 'name')); |
|
326 | + $sortations[] = $search->sort($direction, $sortfunc); |
|
327 | 327 | break; |
328 | 328 | |
329 | 329 | case 'relevance': |
330 | 330 | // we don't need to sort by 'sort:index.text.relevance' because it's a boolean match (relevance is either 0 or 1) |
331 | 331 | } |
332 | 332 | |
333 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
334 | - $search->setSortations( $sortations ); |
|
335 | - $search->setSlice( $start, $size ); |
|
333 | + $search->setConditions($search->combine('&&', $expr)); |
|
334 | + $search->setSortations($sortations); |
|
335 | + $search->setSlice($start, $size); |
|
336 | 336 | |
337 | 337 | return $search; |
338 | 338 | } |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
345 | 345 | * @return array Associative list of the product ID as key and the product text as value |
346 | 346 | */ |
347 | - public function getTextList( \Aimeos\MW\Criteria\Iface $filter ) |
|
347 | + public function getTextList(\Aimeos\MW\Criteria\Iface $filter) |
|
348 | 348 | { |
349 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index/text' )->searchTexts( $filter ); |
|
349 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'index/text')->searchTexts($filter); |
|
350 | 350 | } |
351 | 351 | } |
@@ -256,6 +256,7 @@ |
||
256 | 256 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
257 | 257 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
258 | 258 | * @param integer &$total Parameter where the total number of found products will be stored in |
259 | + * @param integer $total |
|
259 | 260 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
260 | 261 | * @since 2015.08 |
261 | 262 | */ |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param string $name Name of the manager |
28 | 28 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
29 | 29 | */ |
30 | - public function createManager( $name ); |
|
30 | + public function createManager($name); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
48 | 48 | * @since 2015.08 |
49 | 49 | */ |
50 | - public function getCatalogPath( $id, array $domains = array( 'text', 'media' ) ); |
|
50 | + public function getCatalogPath($id, array $domains = array('text', 'media')); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | /** |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
62 | 62 | * @since 2015.08 |
63 | 63 | */ |
64 | - public function getCatalogTree( $id = null, array $domains = array( 'text', 'media' ), |
|
65 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ); |
|
64 | + public function getCatalogTree($id = null, array $domains = array('text', 'media'), |
|
65 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null); |
|
66 | 66 | |
67 | 67 | |
68 | 68 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @return array Associative list of key values as key and the product count for this key as value |
74 | 74 | * @since 2015.08 |
75 | 75 | */ |
76 | - public function aggregateIndex( \Aimeos\MW\Criteria\Iface $filter, $key ); |
|
76 | + public function aggregateIndex(\Aimeos\MW\Criteria\Iface $filter, $key); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
85 | 85 | * @since 2015.08 |
86 | 86 | */ |
87 | - public function addIndexFilterCategory( \Aimeos\MW\Criteria\Iface $search, $catid ); |
|
87 | + public function addIndexFilterCategory(\Aimeos\MW\Criteria\Iface $search, $catid); |
|
88 | 88 | |
89 | 89 | |
90 | 90 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
97 | 97 | * @since 2015.08 |
98 | 98 | */ |
99 | - public function addIndexFilterText( \Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default' ); |
|
99 | + public function addIndexFilterText(\Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default'); |
|
100 | 100 | |
101 | 101 | |
102 | 102 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
111 | 111 | * @since 2015.08 |
112 | 112 | */ |
113 | - public function createIndexFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ); |
|
113 | + public function createIndexFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default'); |
|
114 | 114 | |
115 | 115 | |
116 | 116 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
126 | 126 | * @since 2015.08 |
127 | 127 | */ |
128 | - public function createIndexFilterCategory( $catid, $sort = 'position', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default' ); |
|
128 | + public function createIndexFilterCategory($catid, $sort = 'position', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default'); |
|
129 | 129 | |
130 | 130 | |
131 | 131 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
141 | 141 | * @since 2015.08 |
142 | 142 | */ |
143 | - public function createIndexFilterText( $input, $sort = 'relevance', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default' ); |
|
143 | + public function createIndexFilterText($input, $sort = 'relevance', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default'); |
|
144 | 144 | |
145 | 145 | |
146 | 146 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
153 | 153 | * @since 2015.08 |
154 | 154 | */ |
155 | - public function getIndexItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ); |
|
155 | + public function getIndexItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null); |
|
156 | 156 | |
157 | 157 | |
158 | 158 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @return array List of product items implementing \Aimeos\MShop\Product\Item\Iface |
164 | 164 | * @since 2015.08 |
165 | 165 | */ |
166 | - public function getProductItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ); |
|
166 | + public function getProductItems(array $ids, array $domains = array('media', 'price', 'text')); |
|
167 | 167 | |
168 | 168 | |
169 | 169 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @param string $type Type of the text like "name", "short", "long", etc. |
179 | 179 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
180 | 180 | */ |
181 | - public function createTextFilter( $input, $sort = null, $direction = 'desc', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ); |
|
181 | + public function createTextFilter($input, $sort = null, $direction = 'desc', $start = 0, $size = 25, $listtype = 'default', $type = 'name'); |
|
182 | 182 | |
183 | 183 | |
184 | 184 | /** |
@@ -187,5 +187,5 @@ discard block |
||
187 | 187 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
188 | 188 | * @return array Associative list of the product ID as key and the product text as value |
189 | 189 | */ |
190 | - public function getTextList( \Aimeos\MW\Criteria\Iface $filter ); |
|
190 | + public function getTextList(\Aimeos\MW\Criteria\Iface $filter); |
|
191 | 191 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
30 | 30 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/frontend/catalog/name |
35 | 35 | * Class name of the used catalog frontend controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2014.03 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'controller/frontend/catalog/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('controller/frontend/catalog/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name; |
79 | 79 | |
80 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
80 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/frontend/catalog/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the catalog frontend controllers |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @see controller/frontend/catalog/decorators/excludes |
154 | 154 | * @see controller/frontend/catalog/decorators/global |
155 | 155 | */ |
156 | - return self::addControllerDecorators( $context, $manager, 'catalog' ); |
|
156 | + return self::addControllerDecorators($context, $manager, 'catalog'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | } |
@@ -32,22 +32,22 @@ discard block |
||
32 | 32 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
33 | 33 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
34 | 34 | */ |
35 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
35 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
36 | 36 | { |
37 | 37 | $context = $this->getContext(); |
38 | 38 | |
39 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
40 | - $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
39 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
40 | + $orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
41 | 41 | |
42 | 42 | |
43 | 43 | $orderBaseManager->begin(); |
44 | - $orderBaseManager->store( $basket ); |
|
44 | + $orderBaseManager->store($basket); |
|
45 | 45 | $orderBaseManager->commit(); |
46 | 46 | |
47 | 47 | $orderItem = $orderManager->createItem(); |
48 | - $orderItem->setBaseId( $basket->getId() ); |
|
49 | - $orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB ); |
|
50 | - $orderManager->saveItem( $orderItem ); |
|
48 | + $orderItem->setBaseId($basket->getId()); |
|
49 | + $orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB); |
|
50 | + $orderManager->saveItem($orderItem); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | return $orderItem; |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
74 | 74 | */ |
75 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
75 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
76 | 76 | { |
77 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem ); |
|
77 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
98 | 98 | */ |
99 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
99 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
100 | 100 | { |
101 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem ); |
|
101 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
118 | 118 | */ |
119 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
119 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
120 | 120 | { |
121 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem ); |
|
121 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem); |
|
122 | 122 | } |
123 | 123 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
32 | 32 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
33 | 33 | */ |
34 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
34 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
54 | 54 | * @return void |
55 | 55 | */ |
56 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
56 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
76 | 76 | * @return void |
77 | 77 | */ |
78 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
78 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
79 | 79 | |
80 | 80 | |
81 | 81 | /** |
@@ -93,5 +93,5 @@ discard block |
||
93 | 93 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
94 | 94 | * @return void |
95 | 95 | */ |
96 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
96 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
97 | 97 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
30 | 30 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/frontend/order/name |
35 | 35 | * Class name of the used order frontend controller implementation |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | * @since 2014.03 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'controller/frontend/order/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('controller/frontend/order/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) { |
|
72 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Order\\' . $name : '<not a string>'; |
|
73 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
71 | + if (ctype_alnum($name) === false) { |
|
72 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Order\\' . $name : '<not a string>'; |
|
73 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $iface = '\\Aimeos\\Controller\\Frontend\\Order\\Iface'; |
77 | 77 | $classname = '\\Aimeos\\Controller\\Frontend\\Order\\' . $name; |
78 | 78 | |
79 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
79 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
80 | 80 | |
81 | 81 | /** controller/frontend/order/decorators/excludes |
82 | 82 | * Excludes decorators added by the "common" option from the order frontend controllers |
@@ -152,6 +152,6 @@ discard block |
||
152 | 152 | * @see controller/frontend/order/decorators/excludes |
153 | 153 | * @see controller/frontend/order/decorators/global |
154 | 154 | */ |
155 | - return self::addControllerDecorators( $context, $manager, 'order' ); |
|
155 | + return self::addControllerDecorators($context, $manager, 'order'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -17,33 +17,33 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $context = \TestHelperFrontend::getContext(); |
20 | - $cntl = new \Aimeos\Controller\Frontend\Catalog\Standard( $context ); |
|
20 | + $cntl = new \Aimeos\Controller\Frontend\Catalog\Standard($context); |
|
21 | 21 | |
22 | - $this->object = new \Aimeos\Controller\Frontend\Common\Decorator\Example( $cntl, $context ); |
|
22 | + $this->object = new \Aimeos\Controller\Frontend\Common\Decorator\Example($cntl, $context); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCall() |
27 | 27 | { |
28 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'product' ) ); |
|
28 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager('product')); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCallInvalid() |
33 | 33 | { |
34 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
34 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
35 | 35 | $this->object->invalidMethod(); |
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetContext() |
40 | 40 | { |
41 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $this->object->getContext() ); |
|
41 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $this->object->getContext()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testGetController() |
46 | 46 | { |
47 | - $this->assertInstanceOf( '\Aimeos\Controller\Frontend\Iface', $this->object->getController() ); |
|
47 | + $this->assertInstanceOf('\Aimeos\Controller\Frontend\Iface', $this->object->getController()); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
30 | 30 | */ |
31 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
31 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
32 | 32 | { |
33 | 33 | $this->context = $context; |
34 | 34 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param array $param List of method parameter |
42 | 42 | * @return boolean Returns always false |
43 | 43 | */ |
44 | - public function __call( $name, array $param ) |
|
44 | + public function __call($name, array $param) |
|
45 | 45 | { |
46 | 46 | return false; |
47 | 47 | } |