@@ -35,43 +35,43 @@ discard block |
||
35 | 35 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items |
36 | 36 | * @throws \Exception If an error occurs |
37 | 37 | */ |
38 | - public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
39 | - $ref = array( 'media', 'price', 'text' ) ) |
|
38 | + public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
39 | + $ref = array('media', 'price', 'text')) |
|
40 | 40 | { |
41 | - if( isset( $this->items[$type] ) ) { |
|
41 | + if (isset($this->items[$type])) { |
|
42 | 42 | return $this->items[$type]; |
43 | 43 | } |
44 | 44 | |
45 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
45 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
46 | 46 | |
47 | - $search = $serviceManager->createSearch( true ); |
|
47 | + $search = $serviceManager->createSearch(true); |
|
48 | 48 | $expr = array( |
49 | 49 | $search->getConditions(), |
50 | - $search->compare( '==', 'service.type.domain', 'service' ), |
|
51 | - $search->compare( '==', 'service.type.code', $type ), |
|
50 | + $search->compare('==', 'service.type.domain', 'service'), |
|
51 | + $search->compare('==', 'service.type.code', $type), |
|
52 | 52 | ); |
53 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
54 | - $search->setSortations( array( $search->sort( '+', 'service.position' ) ) ); |
|
53 | + $search->setConditions($search->combine('&&', $expr)); |
|
54 | + $search->setSortations(array($search->sort('+', 'service.position'))); |
|
55 | 55 | |
56 | - $this->items[$type] = $serviceManager->searchItems( $search, $ref ); |
|
56 | + $this->items[$type] = $serviceManager->searchItems($search, $ref); |
|
57 | 57 | |
58 | 58 | |
59 | - foreach( $this->items[$type] as $id => $service ) |
|
59 | + foreach ($this->items[$type] as $id => $service) |
|
60 | 60 | { |
61 | 61 | try |
62 | 62 | { |
63 | - $provider = $serviceManager->getProvider( $service ); |
|
63 | + $provider = $serviceManager->getProvider($service); |
|
64 | 64 | |
65 | - if( $provider->isAvailable( $basket ) ) { |
|
65 | + if ($provider->isAvailable($basket)) { |
|
66 | 66 | $this->providers[$type][$id] = $provider; |
67 | 67 | } else { |
68 | - unset( $this->items[$type][$id] ); |
|
68 | + unset($this->items[$type][$id]); |
|
69 | 69 | } |
70 | 70 | } |
71 | - catch( \Aimeos\MShop\Service\Exception $e ) |
|
71 | + catch (\Aimeos\MShop\Service\Exception $e) |
|
72 | 72 | { |
73 | - $msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id ); |
|
74 | - $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN ); |
|
73 | + $msg = sprintf('Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id); |
|
74 | + $this->getContext()->getLogger()->log($msg, \Aimeos\MW\Logger\Base::WARN); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
92 | 92 | * @throws \Exception If an error occurs |
93 | 93 | */ |
94 | - public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
94 | + public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
95 | 95 | { |
96 | - if( isset( $this->providers[$type][$serviceId] ) ) { |
|
97 | - return $this->providers[$type][$serviceId]->getConfigFE( $basket ); |
|
96 | + if (isset($this->providers[$type][$serviceId])) { |
|
97 | + return $this->providers[$type][$serviceId]->getConfigFE($basket); |
|
98 | 98 | } |
99 | 99 | |
100 | - $item = $this->getServiceItem( $type, $serviceId ); |
|
101 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
100 | + $item = $this->getServiceItem($type, $serviceId); |
|
101 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
102 | 102 | |
103 | - return $serviceManager->getProvider( $item )->getConfigFE( $basket ); |
|
103 | + return $serviceManager->getProvider($item)->getConfigFE($basket); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -115,16 +115,16 @@ discard block |
||
115 | 115 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
116 | 116 | * @throws \Exception If an error occurs |
117 | 117 | */ |
118 | - public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
118 | + public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
119 | 119 | { |
120 | - if( isset( $this->providers[$type][$serviceId] ) ) { |
|
121 | - return $this->providers[$type][$serviceId]->calcPrice( $basket ); |
|
120 | + if (isset($this->providers[$type][$serviceId])) { |
|
121 | + return $this->providers[$type][$serviceId]->calcPrice($basket); |
|
122 | 122 | } |
123 | 123 | |
124 | - $item = $this->getServiceItem( $type, $serviceId ); |
|
125 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
124 | + $item = $this->getServiceItem($type, $serviceId); |
|
125 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
126 | 126 | |
127 | - return $serviceManager->getProvider( $item )->calcPrice( $basket ); |
|
127 | + return $serviceManager->getProvider($item)->calcPrice($basket); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -139,16 +139,16 @@ discard block |
||
139 | 139 | * known by the provider but aren't valid resp. null for attributes whose values are OK |
140 | 140 | * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available |
141 | 141 | */ |
142 | - public function checkServiceAttributes( $type, $serviceId, array $attributes ) |
|
142 | + public function checkServiceAttributes($type, $serviceId, array $attributes) |
|
143 | 143 | { |
144 | - if( isset( $this->providers[$type][$serviceId] ) ) { |
|
145 | - return $this->providers[$type][$serviceId]->checkConfigFE( $attributes ); |
|
144 | + if (isset($this->providers[$type][$serviceId])) { |
|
145 | + return $this->providers[$type][$serviceId]->checkConfigFE($attributes); |
|
146 | 146 | } |
147 | 147 | |
148 | - $item = $this->getServiceItem( $type, $serviceId ); |
|
149 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
148 | + $item = $this->getServiceItem($type, $serviceId); |
|
149 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
150 | 150 | |
151 | - return $serviceManager->getProvider( $item )->checkConfigFE( $attributes ); |
|
151 | + return $serviceManager->getProvider($item)->checkConfigFE($attributes); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -159,25 +159,25 @@ discard block |
||
159 | 159 | * @param string $serviceId Identifier of the service option chosen by the customer |
160 | 160 | * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available |
161 | 161 | */ |
162 | - protected function getServiceItem( $type, $serviceId ) |
|
162 | + protected function getServiceItem($type, $serviceId) |
|
163 | 163 | { |
164 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
164 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
165 | 165 | |
166 | - $search = $serviceManager->createSearch( true ); |
|
166 | + $search = $serviceManager->createSearch(true); |
|
167 | 167 | $expr = array( |
168 | 168 | $search->getConditions(), |
169 | - $search->compare( '==', 'service.id', $serviceId ), |
|
170 | - $search->compare( '==', 'service.type.domain', 'service' ), |
|
171 | - $search->compare( '==', 'service.type.code', $type ), |
|
169 | + $search->compare('==', 'service.id', $serviceId), |
|
170 | + $search->compare('==', 'service.type.domain', 'service'), |
|
171 | + $search->compare('==', 'service.type.code', $type), |
|
172 | 172 | ); |
173 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
173 | + $search->setConditions($search->combine('&&', $expr)); |
|
174 | 174 | |
175 | - $items = $serviceManager->searchItems( $search, array( 'price' ) ); |
|
175 | + $items = $serviceManager->searchItems($search, array('price')); |
|
176 | 176 | |
177 | - if( ( $item = reset( $items ) ) === false ) |
|
177 | + if (($item = reset($items)) === false) |
|
178 | 178 | { |
179 | - $msg = sprintf( 'Service item for type "%1$s" and ID "%2$s" not found', $type, $serviceId ); |
|
180 | - throw new \Aimeos\Controller\Frontend\Service\Exception( $msg ); |
|
179 | + $msg = sprintf('Service item for type "%1$s" and ID "%2$s" not found', $type, $serviceId); |
|
180 | + throw new \Aimeos\Controller\Frontend\Service\Exception($msg); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return $item; |
@@ -67,8 +67,7 @@ |
||
67 | 67 | } else { |
68 | 68 | unset( $this->items[$type][$id] ); |
69 | 69 | } |
70 | - } |
|
71 | - catch( \Aimeos\MShop\Service\Exception $e ) |
|
70 | + } catch( \Aimeos\MShop\Service\Exception $e ) |
|
72 | 71 | { |
73 | 72 | $msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id ); |
74 | 73 | $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN ); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
30 | 30 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items |
31 | 31 | */ |
32 | - public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
33 | - $ref = array( 'media', 'price', 'text' ) ); |
|
32 | + public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
33 | + $ref = array('media', 'price', 'text')); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Returns the list of attribute definitions which must be used to render the input form where the customer can |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object |
42 | 42 | * @return array List of attribute definitions implementing \Aimeos\MW\Criteria\Attribute\Iface |
43 | 43 | */ |
44 | - public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
44 | + public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Returns the price of the service. |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
55 | 55 | * @throws \Exception If an error occurs |
56 | 56 | */ |
57 | - public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
57 | + public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Returns a list of attributes that are invalid. |
@@ -66,5 +66,5 @@ discard block |
||
66 | 66 | * @return array List of key/value pairs of attributes keys and an error message for values that are invalid or |
67 | 67 | * missing |
68 | 68 | */ |
69 | - public function checkServiceAttributes( $type, $serviceId, array $attributes ); |
|
69 | + public function checkServiceAttributes($type, $serviceId, array $attributes); |
|
70 | 70 | } |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @param integer $id Context ID the objects have been created with (string of \Aimeos\MShop\Context\Item\Iface) |
31 | 31 | * @param string $path Path describing the controller to clear, e.g. "basket" |
32 | 32 | */ |
33 | - static public function clear( $id = null, $path = null ) |
|
33 | + static public function clear($id = null, $path = null) |
|
34 | 34 | { |
35 | - if( $id !== null ) |
|
35 | + if ($id !== null) |
|
36 | 36 | { |
37 | - if( $path !== null ) { |
|
37 | + if ($path !== null) { |
|
38 | 38 | self::$controllers[$id][$path] = null; |
39 | 39 | } else { |
40 | 40 | self::$controllers[$id] = array(); |
@@ -61,37 +61,37 @@ discard block |
||
61 | 61 | * @param string $path Name of the domain (and sub-managers) separated by slashes, e.g "basket" |
62 | 62 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
63 | 63 | */ |
64 | - static public function createController( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
|
64 | + static public function createController(\Aimeos\MShop\Context\Item\Iface $context, $path) |
|
65 | 65 | { |
66 | - if( empty( $path ) ) { |
|
67 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Controller path is empty' ) ); |
|
66 | + if (empty($path)) { |
|
67 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Controller path is empty')); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $id = (string) $context; |
71 | 71 | |
72 | - if( self::$cache === false || !isset( self::$controllers[$id][$path] ) ) |
|
72 | + if (self::$cache === false || !isset(self::$controllers[$id][$path])) |
|
73 | 73 | { |
74 | - $parts = explode( '/', $path ); |
|
74 | + $parts = explode('/', $path); |
|
75 | 75 | |
76 | - foreach( $parts as $key => $part ) |
|
76 | + foreach ($parts as $key => $part) |
|
77 | 77 | { |
78 | - if( ctype_alnum( $part ) === false ) { |
|
79 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in controller name "%1$s" in "%2$s"', $part, $path ) ); |
|
78 | + if (ctype_alnum($part) === false) { |
|
79 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in controller name "%1$s" in "%2$s"', $part, $path)); |
|
80 | 80 | } |
81 | 81 | |
82 | - $parts[$key] = ucwords( $part ); |
|
82 | + $parts[$key] = ucwords($part); |
|
83 | 83 | } |
84 | 84 | |
85 | - $factory = '\\Aimeos\\Controller\\Frontend\\' . join( '\\', $parts ) . '\\Factory'; |
|
85 | + $factory = '\\Aimeos\\Controller\\Frontend\\' . join('\\', $parts) . '\\Factory'; |
|
86 | 86 | |
87 | - if( class_exists( $factory ) === false ) { |
|
88 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
87 | + if (class_exists($factory) === false) { |
|
88 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
89 | 89 | } |
90 | 90 | |
91 | - $manager = call_user_func_array( array( $factory, 'createController' ), array( $context ) ); |
|
91 | + $manager = call_user_func_array(array($factory, 'createController'), array($context)); |
|
92 | 92 | |
93 | - if( $manager === false ) { |
|
94 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
93 | + if ($manager === false) { |
|
94 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | self::$controllers[$id][$path] = $manager; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param boolean $value True to enable caching, false to disable it. |
108 | 108 | * @return boolean Previous cache setting |
109 | 109 | */ |
110 | - static public function setCache( $value ) |
|
110 | + static public function setCache($value) |
|
111 | 111 | { |
112 | 112 | $old = self::$cache; |
113 | 113 | self::$cache = (boolean) $value; |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @param string|null $name Name of the controller implementation (Default if null) |
28 | 28 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
29 | 29 | */ |
30 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ); |
|
30 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null); |
|
31 | 31 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param string $classname Full name of the class for which the object should be returned |
32 | 32 | * @param \Aimeos\Controller\Frontend\Iface|null $controller Frontend controller object |
33 | 33 | */ |
34 | - public static function injectController( $classname, \Aimeos\Controller\Frontend\Iface $controller = null ) |
|
34 | + public static function injectController($classname, \Aimeos\Controller\Frontend\Iface $controller = null) |
|
35 | 35 | { |
36 | 36 | self::$objects[$classname] = $controller; |
37 | 37 | } |
@@ -46,29 +46,29 @@ discard block |
||
46 | 46 | * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Controller\Frontend\Basket\Decorator\" |
47 | 47 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
48 | 48 | */ |
49 | - protected static function addDecorators( \Aimeos\MShop\Context\Item\Iface $context, |
|
50 | - \Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix ) |
|
49 | + protected static function addDecorators(\Aimeos\MShop\Context\Item\Iface $context, |
|
50 | + \Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix) |
|
51 | 51 | { |
52 | 52 | $iface = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface'; |
53 | 53 | |
54 | - foreach( $decorators as $name ) |
|
54 | + foreach ($decorators as $name) |
|
55 | 55 | { |
56 | - if( ctype_alnum( $name ) === false ) |
|
56 | + if (ctype_alnum($name) === false) |
|
57 | 57 | { |
58 | - $classname = is_string( $name ) ? $classprefix . $name : '<not a string>'; |
|
59 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
58 | + $classname = is_string($name) ? $classprefix . $name : '<not a string>'; |
|
59 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $classname = $classprefix . $name; |
63 | 63 | |
64 | - if( class_exists( $classname ) === false ) { |
|
65 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
|
64 | + if (class_exists($classname) === false) { |
|
65 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname)); |
|
66 | 66 | } |
67 | 67 | |
68 | - $controller = new $classname( $controller, $context ); |
|
68 | + $controller = new $classname($controller, $context); |
|
69 | 69 | |
70 | - if( !( $controller instanceof $iface ) ) { |
|
71 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $iface ) ); |
|
70 | + if (!($controller instanceof $iface)) { |
|
71 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $iface)); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | * @param string $domain Domain name in lower case, e.g. "product" |
85 | 85 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
86 | 86 | */ |
87 | - protected static function addControllerDecorators( \Aimeos\MShop\Context\Item\Iface $context, |
|
88 | - \Aimeos\Controller\Frontend\Iface $controller, $domain ) |
|
87 | + protected static function addControllerDecorators(\Aimeos\MShop\Context\Item\Iface $context, |
|
88 | + \Aimeos\Controller\Frontend\Iface $controller, $domain) |
|
89 | 89 | { |
90 | - if( !is_string( $domain ) || $domain === '' ) { |
|
91 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid domain "%1$s"', $domain ) ); |
|
90 | + if (!is_string($domain) || $domain === '') { |
|
91 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid domain "%1$s"', $domain)); |
|
92 | 92 | } |
93 | 93 | |
94 | - $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $domain ) ) ); |
|
94 | + $localClass = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $domain))); |
|
95 | 95 | $config = $context->getConfig(); |
96 | 96 | |
97 | 97 | /** controller/frontend/common/decorators/default |
@@ -116,26 +116,26 @@ discard block |
||
116 | 116 | * @since 2014.03 |
117 | 117 | * @category Developer |
118 | 118 | */ |
119 | - $decorators = $config->get( 'controller/frontend/common/decorators/default', array() ); |
|
120 | - $excludes = $config->get( 'controller/frontend/' . $domain . '/decorators/excludes', array() ); |
|
119 | + $decorators = $config->get('controller/frontend/common/decorators/default', array()); |
|
120 | + $excludes = $config->get('controller/frontend/' . $domain . '/decorators/excludes', array()); |
|
121 | 121 | |
122 | - foreach( $decorators as $key => $name ) |
|
122 | + foreach ($decorators as $key => $name) |
|
123 | 123 | { |
124 | - if( in_array( $name, $excludes ) ) { |
|
125 | - unset( $decorators[$key] ); |
|
124 | + if (in_array($name, $excludes)) { |
|
125 | + unset($decorators[$key]); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | 129 | $classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\'; |
130 | - $controller = self::addDecorators( $context, $controller, $decorators, $classprefix ); |
|
130 | + $controller = self::addDecorators($context, $controller, $decorators, $classprefix); |
|
131 | 131 | |
132 | 132 | $classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\'; |
133 | - $decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/global', array() ); |
|
134 | - $controller = self::addDecorators( $context, $controller, $decorators, $classprefix ); |
|
133 | + $decorators = $config->get('controller/frontend/' . $domain . '/decorators/global', array()); |
|
134 | + $controller = self::addDecorators($context, $controller, $decorators, $classprefix); |
|
135 | 135 | |
136 | - $classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst( $localClass ) . '\\Decorator\\'; |
|
137 | - $decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/local', array() ); |
|
138 | - $controller = self::addDecorators( $context, $controller, $decorators, $classprefix ); |
|
136 | + $classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst($localClass) . '\\Decorator\\'; |
|
137 | + $decorators = $config->get('controller/frontend/' . $domain . '/decorators/local', array()); |
|
138 | + $controller = self::addDecorators($context, $controller, $decorators, $classprefix); |
|
139 | 139 | |
140 | 140 | return $controller; |
141 | 141 | } |
@@ -149,20 +149,20 @@ discard block |
||
149 | 149 | * @param string $interface Name of the controller interface |
150 | 150 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
151 | 151 | */ |
152 | - protected static function createControllerBase( \Aimeos\MShop\Context\Item\Iface $context, $classname, $interface ) |
|
152 | + protected static function createControllerBase(\Aimeos\MShop\Context\Item\Iface $context, $classname, $interface) |
|
153 | 153 | { |
154 | - if( isset( self::$objects[$classname] ) ) { |
|
154 | + if (isset(self::$objects[$classname])) { |
|
155 | 155 | return self::$objects[$classname]; |
156 | 156 | } |
157 | 157 | |
158 | - if( class_exists( $classname ) === false ) { |
|
159 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
|
158 | + if (class_exists($classname) === false) { |
|
159 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname)); |
|
160 | 160 | } |
161 | 161 | |
162 | - $controller = new $classname( $context ); |
|
162 | + $controller = new $classname($context); |
|
163 | 163 | |
164 | - if( !( $controller instanceof $interface ) ) { |
|
165 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface ) ); |
|
164 | + if (!($controller instanceof $interface)) { |
|
165 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $interface)); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $controller; |
@@ -32,9 +32,9 @@ |
||
32 | 32 | * @param \Exception $previous The previous exception used for the exception chaining. |
33 | 33 | * @param array $list The associative list of errors and their messages when several errors occured |
34 | 34 | */ |
35 | - public function __construct( $msg = '', $code = 0, \Exception $previous = null, array $list = array() ) |
|
35 | + public function __construct($msg = '', $code = 0, \Exception $previous = null, array $list = array()) |
|
36 | 36 | { |
37 | - parent::__construct( $msg, $code, $previous ); |
|
37 | + parent::__construct($msg, $code, $previous); |
|
38 | 38 | |
39 | 39 | $this->list = $list; |
40 | 40 | } |
@@ -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 | } |
@@ -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 | } |