@@ -248,7 +248,7 @@ |
||
248 | 248 | * |
249 | 249 | * @param string $manager Name of the sub manager type in lower case |
250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
252 | 252 | */ |
253 | 253 | public function getSubManager( $manager, $name = null ) |
254 | 254 | { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'label' => 'Customer address ID', |
27 | 27 | 'code' => 'customer.address.id', |
28 | 28 | 'internalcode' => 'ezuad."id"', |
29 | - 'internaldeps' => array( 'LEFT JOIN "ezuser_address" AS ezuad ON ( ezu."contentobject_id" = ezuad."parentid" )' ), |
|
29 | + 'internaldeps' => array('LEFT JOIN "ezuser_address" AS ezuad ON ( ezu."contentobject_id" = ezuad."parentid" )'), |
|
30 | 30 | 'type' => 'integer', |
31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
32 | 32 | 'public' => false, |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @param array $siteids List of IDs for sites whose entries should be deleted |
211 | 211 | */ |
212 | - public function cleanup( array $siteids ) |
|
212 | + public function cleanup(array $siteids) |
|
213 | 213 | { |
214 | 214 | $path = 'mshop/customer/manager/address/submanagers'; |
215 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
216 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
215 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
216 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
217 | 217 | } |
218 | 218 | |
219 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/lists/ezpublish/delete' ); |
|
219 | + $this->cleanupBase($siteids, 'mshop/customer/manager/lists/ezpublish/delete'); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | * @param boolean $withsub Return also attributes of sub-managers if true |
227 | 227 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
228 | 228 | */ |
229 | - public function getSearchAttributes( $withsub = true ) |
|
229 | + public function getSearchAttributes($withsub = true) |
|
230 | 230 | { |
231 | 231 | $path = 'mshop/customer/manager/address/submanagers'; |
232 | 232 | |
233 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, [], $withsub ); |
|
233 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, [], $withsub); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
242 | 242 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
243 | 243 | */ |
244 | - public function getSubManager( $manager, $name = null ) |
|
244 | + public function getSubManager($manager, $name = null) |
|
245 | 245 | { |
246 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
246 | + return $this->getSubManagerBase('customer', 'address/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 |
@@ -248,7 +248,7 @@ |
||
248 | 248 | * |
249 | 249 | * @param string $manager Name of the sub manager type in lower case |
250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
252 | 252 | */ |
253 | 253 | public function getSubManager( $manager, $name = null ) |
254 | 254 | { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'customer.lists.id'=> array( |
26 | 26 | 'code'=>'customer.lists.id', |
27 | 27 | 'internalcode'=>'ezuli."id"', |
28 | - 'internaldeps' => array( 'LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )' ), |
|
28 | + 'internaldeps' => array('LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )'), |
|
29 | 29 | 'label'=>'Customer list ID', |
30 | 30 | 'type'=> 'integer', |
31 | 31 | 'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -133,14 +133,14 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @param array $siteids List of IDs for sites whose entries should be deleted |
135 | 135 | */ |
136 | - public function cleanup( array $siteids ) |
|
136 | + public function cleanup(array $siteids) |
|
137 | 137 | { |
138 | 138 | $path = 'mshop/customer/manager/lists/submanagers'; |
139 | - foreach( $this->getContext()->getConfig()->get( $path, array( 'type' ) ) as $domain ) { |
|
140 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
139 | + foreach ($this->getContext()->getConfig()->get($path, array('type')) as $domain) { |
|
140 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
141 | 141 | } |
142 | 142 | |
143 | - $this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' ); |
|
143 | + $this->cleanupBase($siteids, $this->getConfigPath().'delete'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | * @param boolean $withsub Return also attributes of sub-managers if true |
151 | 151 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
152 | 152 | */ |
153 | - public function getSearchAttributes( $withsub = true ) |
|
153 | + public function getSearchAttributes($withsub = true) |
|
154 | 154 | { |
155 | 155 | $path = 'mshop/customer/manager/lists/submanagers'; |
156 | 156 | |
157 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, ['type'], $withsub ); |
|
157 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, ['type'], $withsub); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
166 | 166 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
167 | 167 | */ |
168 | - public function getSubManager( $manager, $name = null ) |
|
168 | + public function getSubManager($manager, $name = null) |
|
169 | 169 | { |
170 | - return $this->getSubManagerBase( 'customer', 'lists/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
170 | + return $this->getSubManagerBase('customer', 'lists/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -177,15 +177,15 @@ discard block |
||
177 | 177 | * @param \Aimeos\MShop\Common\Item\Lists\Iface $item List item object which should be saved |
178 | 178 | * @param boolean $fetch True if the new ID should be returned in the item |
179 | 179 | */ |
180 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
180 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
181 | 181 | { |
182 | - self::checkClass( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $item ); |
|
182 | + self::checkClass('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $item); |
|
183 | 183 | |
184 | - if( $item->getDomain() === 'customer/group' ) { |
|
185 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) ); |
|
184 | + if ($item->getDomain() === 'customer/group') { |
|
185 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Adding groups to customers is not supported, please use the eZ Publish backend')); |
|
186 | 186 | } |
187 | 187 | |
188 | - parent::saveItem( $item, $fetch ); |
|
188 | + parent::saveItem($item, $fetch); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 |
@@ -248,7 +248,7 @@ |
||
248 | 248 | * |
249 | 249 | * @param string $manager Name of the sub manager type in lower case |
250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
252 | 252 | */ |
253 | 253 | public function getSubManager( $manager, $name = null ) |
254 | 254 | { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'customer.lists.type.id' => array( |
26 | 26 | 'code'=>'customer.lists.type.id', |
27 | 27 | 'internalcode'=>'ezulity."id"', |
28 | - 'internaldeps'=>array( 'LEFT JOIN "ezuser_list_type" AS ezulity ON ( ezuli."typeid" = ezulity."id" )' ), |
|
28 | + 'internaldeps'=>array('LEFT JOIN "ezuser_list_type" AS ezulity ON ( ezuli."typeid" = ezulity."id" )'), |
|
29 | 29 | 'label'=>'Customer list type ID', |
30 | 30 | 'type'=> 'integer', |
31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param array $siteids List of IDs for sites whose entries should be deleted |
98 | 98 | */ |
99 | - public function cleanup( array $siteids ) |
|
99 | + public function cleanup(array $siteids) |
|
100 | 100 | { |
101 | 101 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
102 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
103 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
102 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
103 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
104 | 104 | } |
105 | 105 | |
106 | - $this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' ); |
|
106 | + $this->cleanupBase($siteids, $this->getConfigPath().'delete'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | * @param boolean $withsub Return also attributes of sub-managers if true |
114 | 114 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
115 | 115 | */ |
116 | - public function getSearchAttributes( $withsub = true ) |
|
116 | + public function getSearchAttributes($withsub = true) |
|
117 | 117 | { |
118 | 118 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
119 | 119 | |
120 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, [], $withsub ); |
|
120 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, [], $withsub); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
129 | 129 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
130 | 130 | */ |
131 | - public function getSubManager( $manager, $name = null ) |
|
131 | + public function getSubManager($manager, $name = null) |
|
132 | 132 | { |
133 | - return $this->getSubManagerBase( 'customer', 'lists/type/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
133 | + return $this->getSubManagerBase('customer', 'lists/type/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $includepaths = $aimeos->getIncludePaths(); |
20 | 20 | $includepaths[] = get_include_path(); |
21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | - public static function getContext( $site = 'unittest' ) |
|
25 | + public static function getContext($site = 'unittest') |
|
26 | 26 | { |
27 | - if( !isset( self::$context[$site] ) ) { |
|
28 | - self::$context[$site] = self::createContext( $site ); |
|
27 | + if (!isset(self::$context[$site])) { |
|
28 | + self::$context[$site] = self::createContext($site); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return clone self::$context[$site]; |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | private static function getAimeos() |
36 | 36 | { |
37 | - if( !isset( self::$aimeos ) ) |
|
37 | + if (!isset(self::$aimeos)) |
|
38 | 38 | { |
39 | 39 | require_once 'Bootstrap.php'; |
40 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
40 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
41 | 41 | |
42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
42 | + $extdir = dirname(dirname(dirname(__DIR__))); |
|
43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return self::$aimeos; |
@@ -50,45 +50,45 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @param string $site |
52 | 52 | */ |
53 | - private static function createContext( $site ) |
|
53 | + private static function createContext($site) |
|
54 | 54 | { |
55 | 55 | $ctx = new \Aimeos\MShop\Context\Item\Ezpublish(); |
56 | 56 | $aimeos = self::getAimeos(); |
57 | 57 | |
58 | 58 | |
59 | 59 | $paths = $aimeos->getConfigPaths(); |
60 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
60 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
61 | 61 | |
62 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
|
63 | - $ctx->setConfig( $conf ); |
|
62 | + $conf = new \Aimeos\MW\Config\PHPArray([], $paths); |
|
63 | + $ctx->setConfig($conf); |
|
64 | 64 | |
65 | 65 | |
66 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf ); |
|
67 | - $ctx->setDatabaseManager( $dbm ); |
|
66 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($conf); |
|
67 | + $ctx->setDatabaseManager($dbm); |
|
68 | 68 | |
69 | 69 | |
70 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
71 | - $ctx->setLogger( $logger ); |
|
70 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
71 | + $ctx->setLogger($logger); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | $cache = new \Aimeos\MW\Cache\None(); |
75 | - $ctx->setCache( $cache ); |
|
75 | + $ctx->setCache($cache); |
|
76 | 76 | |
77 | 77 | |
78 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
79 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
78 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
79 | + $ctx->setI18n(array('de' => $i18n)); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | $session = new \Aimeos\MW\Session\None(); |
83 | - $ctx->setSession( $session ); |
|
83 | + $ctx->setSession($session); |
|
84 | 84 | |
85 | 85 | |
86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
87 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
87 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
88 | 88 | |
89 | - $ctx->setLocale( $localeItem ); |
|
89 | + $ctx->setLocale($localeItem); |
|
90 | 90 | |
91 | - $ctx->setEditor( 'ai-ezpublish:unittest' ); |
|
91 | + $ctx->setEditor('ai-ezpublish:unittest'); |
|
92 | 92 | |
93 | 93 | return $ctx; |
94 | 94 | } |
@@ -16,39 +16,39 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | 20 | |
21 | - $listManager = $manager->getSubManager( 'property', 'Ezpublish' ); |
|
22 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
21 | + $listManager = $manager->getSubManager('property', 'Ezpublish'); |
|
22 | + $this->object = $listManager->getSubManager('type', 'Ezpublish'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - unset( $this->object ); |
|
28 | + unset($this->object); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCleanup() |
33 | 33 | { |
34 | - $this->object->cleanup( array( -1 ) ); |
|
34 | + $this->object->cleanup(array( -1 )); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetSearchAttributes() |
39 | 39 | { |
40 | 40 | $attributes = $this->object->getSearchAttributes(); |
41 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
41 | + $this->assertGreaterThan(0, count($attributes)); |
|
42 | 42 | |
43 | - foreach( $attributes as $attribute ) { |
|
44 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute ); |
|
43 | + foreach ($attributes as $attribute) { |
|
44 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetSubManager() |
50 | 50 | { |
51 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
52 | - $this->object->getSubManager( 'unknown' ); |
|
51 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
52 | + $this->object->getSubManager('unknown'); |
|
53 | 53 | } |
54 | 54 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'customer.property.id' => array( |
25 | 25 | 'code' => 'customer.property.id', |
26 | 26 | 'internalcode' => 'ezppr."id"', |
27 | - 'internaldeps'=>array( 'LEFT JOIN "ezp_user_property" AS ezppr ON ( ezppr."parentid" = ezp."id" )' ), |
|
27 | + 'internaldeps'=>array('LEFT JOIN "ezp_user_property" AS ezppr ON ( ezppr."parentid" = ezp."id" )'), |
|
28 | 28 | 'label' => 'Property ID', |
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @param integer[] $siteids List of IDs for sites whose entries should be deleted |
102 | 102 | */ |
103 | - public function cleanup( array $siteids ) |
|
103 | + public function cleanup(array $siteids) |
|
104 | 104 | { |
105 | 105 | $path = 'mshop/customer/manager/property/submanagers'; |
106 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
107 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
106 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
107 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
108 | 108 | } |
109 | 109 | |
110 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/property/ezpublish/delete' ); |
|
110 | + $this->cleanupBase($siteids, 'mshop/customer/manager/property/ezpublish/delete'); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | * @param boolean $withsub Return also attributes of sub-managers if true |
118 | 118 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
119 | 119 | */ |
120 | - public function getSearchAttributes( $withsub = true ) |
|
120 | + public function getSearchAttributes($withsub = true) |
|
121 | 121 | { |
122 | 122 | $path = 'mshop/customer/manager/property/submanagers'; |
123 | 123 | |
124 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, ['type'], $withsub ); |
|
124 | + return $this->getSearchAttributesBase($this->searchConfig, $path, ['type'], $withsub); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | * configuration (or Default) if null |
134 | 134 | * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g property types, property lists etc. |
135 | 135 | */ |
136 | - public function getSubManager( $manager, $name = null ) |
|
136 | + public function getSubManager($manager, $name = null) |
|
137 | 137 | { |
138 | - return $this->getSubManagerBase( 'customer', 'property/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
138 | + return $this->getSubManagerBase('customer', 'property/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'customer.property.type.id' => array( |
25 | 25 | 'code' => 'customer.property.type.id', |
26 | 26 | 'internalcode' => 'ezpprty."id"', |
27 | - 'internaldeps' => array( 'LEFT JOIN "ezp_user_property_type" AS ezpprty ON ( ezppr."typeid" = ezpprty."id" )' ), |
|
27 | + 'internaldeps' => array('LEFT JOIN "ezp_user_property_type" AS ezpprty ON ( ezppr."typeid" = ezpprty."id" )'), |
|
28 | 28 | 'label' => 'Property type ID', |
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @param array $siteids List of IDs for sites whose entries should be deleted |
107 | 107 | */ |
108 | - public function cleanup( array $siteids ) |
|
108 | + public function cleanup(array $siteids) |
|
109 | 109 | { |
110 | 110 | $path = 'mshop/customer/manager/property/type/submanagers'; |
111 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
112 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
111 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
112 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
113 | 113 | } |
114 | 114 | |
115 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/property/type/ezpublish/delete' ); |
|
115 | + $this->cleanupBase($siteids, 'mshop/customer/manager/property/type/ezpublish/delete'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | * @param boolean $withsub Return also attributes of sub-managers if true |
123 | 123 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
124 | 124 | */ |
125 | - public function getSearchAttributes( $withsub = true ) |
|
125 | + public function getSearchAttributes($withsub = true) |
|
126 | 126 | { |
127 | 127 | $path = 'mshop/customer/manager/property/type/submanagers'; |
128 | 128 | |
129 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
129 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
138 | 138 | * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g types, lists etc. |
139 | 139 | */ |
140 | - public function getSubManager( $manager, $name = null ) |
|
140 | + public function getSubManager($manager, $name = null) |
|
141 | 141 | { |
142 | - return $this->getSubManagerBase( 'customer', 'property/type/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
142 | + return $this->getSubManagerBase('customer', 'property/type/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 |
@@ -8,177 +8,177 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | 12 | |
13 | - $table = $schema->createTable( 'ezuser' ); |
|
13 | + $table = $schema->createTable('ezuser'); |
|
14 | 14 | |
15 | - $table->addColumn( 'contentobject_id', 'integer', [] ); |
|
16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
15 | + $table->addColumn('contentobject_id', 'integer', []); |
|
16 | + $table->addColumn('email', 'string', array('length' => 150)); |
|
17 | + $table->addColumn('login', 'string', array('length' => 150)); |
|
18 | + $table->addColumn('login_normalized', 'string', array('length' => 150)); |
|
19 | + $table->addColumn('password_hash', 'string', array('length' => 50)); |
|
20 | + $table->addColumn('password_hash_type', 'integer', array('default' => 1)); |
|
21 | 21 | |
22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
22 | + $table->setPrimaryKey(array('contentobject_id')); |
|
23 | + $table->addUniqueIndex(array('login_normalized'), 'ezuser_login'); |
|
24 | 24 | |
25 | 25 | return $schema; |
26 | 26 | }, |
27 | 27 | |
28 | - 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
29 | - |
|
30 | - $table = $schema->createTable( 'ezuser_address' ); |
|
31 | - |
|
32 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
33 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
34 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
35 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
36 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
37 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
38 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
39 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
40 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
41 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
42 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
43 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
44 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
45 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
46 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
47 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
48 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
49 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
50 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
51 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
52 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
53 | - $table->addColumn( 'flag', 'integer', [] ); |
|
54 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
55 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
56 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
57 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
58 | - |
|
59 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
60 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
61 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
62 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
63 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
64 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
65 | - |
|
66 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
67 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
28 | + 'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
29 | + |
|
30 | + $table = $schema->createTable('ezuser_address'); |
|
31 | + |
|
32 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
33 | + $table->addColumn('siteid', 'integer', []); |
|
34 | + $table->addColumn('parentid', 'integer', []); |
|
35 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
36 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
37 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
38 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
39 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
40 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
41 | + $table->addColumn('address1', 'string', array('length' => 255)); |
|
42 | + $table->addColumn('address2', 'string', array('length' => 255)); |
|
43 | + $table->addColumn('address3', 'string', array('length' => 255)); |
|
44 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
45 | + $table->addColumn('city', 'string', array('length' => 255)); |
|
46 | + $table->addColumn('state', 'string', array('length' => 255)); |
|
47 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
48 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
49 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
50 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
51 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
52 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
53 | + $table->addColumn('flag', 'integer', []); |
|
54 | + $table->addColumn('pos', 'smallint', []); |
|
55 | + $table->addColumn('mtime', 'datetime', []); |
|
56 | + $table->addColumn('ctime', 'datetime', []); |
|
57 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
58 | + |
|
59 | + $table->setPrimaryKey(array('id'), 'pk_ezpad_id'); |
|
60 | + $table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn'); |
|
61 | + $table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2'); |
|
62 | + $table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci'); |
|
63 | + $table->addIndex(array('parentid'), 'idx_ezpad_pid'); |
|
64 | + $table->addIndex(array('city'), 'idx_ezpad_city'); |
|
65 | + |
|
66 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
67 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid'); |
|
68 | 68 | |
69 | 69 | return $schema; |
70 | 70 | }, |
71 | 71 | |
72 | - 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
72 | + 'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
73 | 73 | |
74 | - $table = $schema->createTable( 'ezuser_list_type' ); |
|
74 | + $table = $schema->createTable('ezuser_list_type'); |
|
75 | 75 | |
76 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
77 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
78 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
79 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
81 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
82 | - $table->addColumn( 'status', 'smallint', [] ); |
|
83 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
84 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
85 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
76 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
77 | + $table->addColumn('siteid', 'integer', []); |
|
78 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
79 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
80 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
81 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
82 | + $table->addColumn('status', 'smallint', []); |
|
83 | + $table->addColumn('mtime', 'datetime', []); |
|
84 | + $table->addColumn('ctime', 'datetime', []); |
|
85 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
86 | 86 | |
87 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
88 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
89 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
90 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
91 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
87 | + $table->setPrimaryKey(array('id'), 'pk_ezplity_id'); |
|
88 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code'); |
|
89 | + $table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status'); |
|
90 | + $table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label'); |
|
91 | + $table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code'); |
|
92 | 92 | |
93 | 93 | return $schema; |
94 | 94 | }, |
95 | 95 | |
96 | - 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
97 | - |
|
98 | - $table = $schema->createTable( 'ezuser_list' ); |
|
99 | - |
|
100 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
101 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
102 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
103 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
104 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
105 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
106 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
107 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
108 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
109 | - $table->addColumn( 'pos', 'integer', [] ); |
|
110 | - $table->addColumn( 'status', 'smallint', [] ); |
|
111 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
112 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
113 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
114 | - |
|
115 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
116 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
117 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
118 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
119 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
120 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
121 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
122 | - |
|
123 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
124 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
125 | - |
|
126 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
127 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
96 | + 'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
97 | + |
|
98 | + $table = $schema->createTable('ezuser_list'); |
|
99 | + |
|
100 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
101 | + $table->addColumn('parentid', 'integer', []); |
|
102 | + $table->addColumn('siteid', 'integer', []); |
|
103 | + $table->addColumn('typeid', 'integer', []); |
|
104 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
105 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
106 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
107 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
108 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
109 | + $table->addColumn('pos', 'integer', []); |
|
110 | + $table->addColumn('status', 'smallint', []); |
|
111 | + $table->addColumn('mtime', 'datetime', []); |
|
112 | + $table->addColumn('ctime', 'datetime', []); |
|
113 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
114 | + |
|
115 | + $table->setPrimaryKey(array('id'), 'pk_ezpli_id'); |
|
116 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid'); |
|
117 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end'); |
|
118 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid'); |
|
119 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start'); |
|
120 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end'); |
|
121 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos'); |
|
122 | + |
|
123 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
124 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid'); |
|
125 | + |
|
126 | + $table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'), |
|
127 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid'); |
|
128 | 128 | |
129 | 129 | return $schema; |
130 | 130 | }, |
131 | 131 | |
132 | - 'ezuser_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
132 | + 'ezuser_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
133 | 133 | |
134 | - $table = $schema->createTable( 'ezuser_property_type' ); |
|
134 | + $table = $schema->createTable('ezuser_property_type'); |
|
135 | 135 | |
136 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
137 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
138 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
139 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
140 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
141 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
142 | - $table->addColumn( 'status', 'smallint', [] ); |
|
143 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
144 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
145 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
136 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
137 | + $table->addColumn('siteid', 'integer', []); |
|
138 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
139 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
140 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
141 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
142 | + $table->addColumn('status', 'smallint', []); |
|
143 | + $table->addColumn('mtime', 'datetime', []); |
|
144 | + $table->addColumn('ctime', 'datetime', []); |
|
145 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
146 | 146 | |
147 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpprty_id' ); |
|
148 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezpprty_sid_dom_code' ); |
|
149 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_ezpprty_sid_status_pos' ); |
|
150 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezpprty_sid_label' ); |
|
151 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezpprty_sid_code' ); |
|
147 | + $table->setPrimaryKey(array('id'), 'pk_ezpprty_id'); |
|
148 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezpprty_sid_dom_code'); |
|
149 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_ezpprty_sid_status_pos'); |
|
150 | + $table->addIndex(array('siteid', 'label'), 'idx_ezpprty_sid_label'); |
|
151 | + $table->addIndex(array('siteid', 'code'), 'idx_ezpprty_sid_code'); |
|
152 | 152 | |
153 | 153 | return $schema; |
154 | 154 | }, |
155 | 155 | |
156 | - 'ezuser_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
156 | + 'ezuser_property' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
157 | 157 | |
158 | - $table = $schema->createTable( 'ezuser_property' ); |
|
158 | + $table = $schema->createTable('ezuser_property'); |
|
159 | 159 | |
160 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
161 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
162 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
163 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
164 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
165 | - $table->addColumn( 'value', 'string', array( 'length' => 255 ) ); |
|
166 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
167 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
168 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
160 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
161 | + $table->addColumn('siteid', 'integer', []); |
|
162 | + $table->addColumn('parentid', 'integer', []); |
|
163 | + $table->addColumn('typeid', 'integer', []); |
|
164 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
165 | + $table->addColumn('value', 'string', array('length' => 255)); |
|
166 | + $table->addColumn('mtime', 'datetime', []); |
|
167 | + $table->addColumn('ctime', 'datetime', []); |
|
168 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
169 | 169 | |
170 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezppr_id' ); |
|
171 | - $table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_ezppr_sid_tid_lid_value' ); |
|
172 | - $table->addIndex( array( 'siteid', 'langid' ), 'idx_ezppr_sid_langid' ); |
|
173 | - $table->addIndex( array( 'siteid', 'value' ), 'idx_ezppr_sid_value' ); |
|
174 | - $table->addIndex( array( 'typeid' ), 'fk_ezppr_typeid' ); |
|
175 | - $table->addIndex( array( 'parentid' ), 'fk_ezppr_pid' ); |
|
170 | + $table->setPrimaryKey(array('id'), 'pk_ezppr_id'); |
|
171 | + $table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_ezppr_sid_tid_lid_value'); |
|
172 | + $table->addIndex(array('siteid', 'langid'), 'idx_ezppr_sid_langid'); |
|
173 | + $table->addIndex(array('siteid', 'value'), 'idx_ezppr_sid_value'); |
|
174 | + $table->addIndex(array('typeid'), 'fk_ezppr_typeid'); |
|
175 | + $table->addIndex(array('parentid'), 'fk_ezppr_pid'); |
|
176 | 176 | |
177 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
178 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezppr_pid' ); |
|
177 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
178 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezppr_pid'); |
|
179 | 179 | |
180 | - $table->addForeignKeyConstraint( 'ezuser_property_type', array( 'typeid' ), array( 'id' ), |
|
181 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezppr_typeid' ); |
|
180 | + $table->addForeignKeyConstraint('ezuser_property_type', array('typeid'), array('id'), |
|
181 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezppr_typeid'); |
|
182 | 182 | |
183 | 183 | return $schema; |
184 | 184 | }, |
@@ -16,57 +16,57 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
20 | - $this->object = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); |
|
20 | + $this->object = $manager->getSubManager('lists', 'Ezpublish'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | protected function tearDown() |
25 | 25 | { |
26 | - unset( $this->object ); |
|
26 | + unset($this->object); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testCleanup() |
31 | 31 | { |
32 | - $this->object->cleanup( array( -1 ) ); |
|
32 | + $this->object->cleanup(array( -1 )); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testGetSearchAttributes() |
37 | 37 | { |
38 | 38 | $attributes = $this->object->getSearchAttributes(); |
39 | - $this->assertGreaterThan( 0, count( $attributes ) ); |
|
39 | + $this->assertGreaterThan(0, count($attributes)); |
|
40 | 40 | |
41 | - foreach( $attributes as $attribute ) { |
|
42 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute ); |
|
41 | + foreach ($attributes as $attribute) { |
|
42 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testGetSubManager() |
48 | 48 | { |
49 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); |
|
49 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); |
|
50 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); |
|
51 | 51 | |
52 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
53 | - $this->object->getSubManager( 'unknown' ); |
|
52 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
53 | + $this->object->getSubManager('unknown'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testSaveItemInvalidItem() |
58 | 58 | { |
59 | - $this->setExpectedException( '\Aimeos\MW\Common\Exception' ); |
|
60 | - $this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) ); |
|
59 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
60 | + $this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.lists.type.')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testSaveItemInvalidDomain() |
65 | 65 | { |
66 | 66 | $item = $this->object->createItem(); |
67 | - $item->setDomain( 'customer/group' ); |
|
67 | + $item->setDomain('customer/group'); |
|
68 | 68 | |
69 | - $this->setExpectedException( '\Aimeos\MShop\Customer\Exception' ); |
|
70 | - $this->object->saveItem( $item ); |
|
69 | + $this->setExpectedException('\Aimeos\MShop\Customer\Exception'); |
|
70 | + $this->object->saveItem($item); |
|
71 | 71 | } |
72 | 72 | } |