Completed
Push — master ( 1ffc07...6d81ff )
by Aimeos
06:29
created
lib/custom/src/MShop/Customer/Manager/Group/Ezpublish.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param integer[] $siteids List of IDs for sites whose entries should be deleted
74 74
 	 */
75
-	public function cleanup( array $siteids )
75
+	public function cleanup(array $siteids)
76 76
 	{
77 77
 	}
78 78
 
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 *
83 83
 	 * @param array $ids List of IDs
84 84
 	 */
85
-	public function deleteItems( array $ids )
85
+	public function deleteItems(array $ids)
86 86
 	{
87
-		throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Deleting groups is not supported, please use the eZ Publish backend' ) );
87
+		throw new \Aimeos\MShop\Customer\Exception(sprintf('Deleting groups is not supported, please use the eZ Publish backend'));
88 88
 	}
89 89
 
90 90
 
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 	 * @param boolean $withsub Return attributes of sub-managers too if true
95 95
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
96 96
 	 */
97
-	public function getSearchAttributes( $withsub = true )
97
+	public function getSearchAttributes($withsub = true)
98 98
 	{
99 99
 		$path = 'mshop/customer/manager/group/submanagers';
100 100
 
101
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub );
101
+		return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub);
102 102
 	}
103 103
 
104 104
 
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
110 110
 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions
111 111
 	 */
112
-	public function getSubManager( $manager, $name = null )
112
+	public function getSubManager($manager, $name = null)
113 113
 	{
114
-		return $this->getSubManagerBase( 'customer/group', $manager, ( $name === null ? 'Ezpublish' : $name ) );
114
+		return $this->getSubManagerBase('customer/group', $manager, ($name === null ? 'Ezpublish' : $name));
115 115
 	}
116 116
 
117 117
 
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	 * @param \Aimeos\MShop\Customer\Item\Group\Iface $item Customer group item
122 122
 	 * @param boolean $fetch True if the new ID should be returned in the item
123 123
 	 */
124
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
124
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
125 125
 	{
126
-		throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Saving groups is not supported, please use the eZ Publish backend' ) );
126
+		throw new \Aimeos\MShop\Customer\Exception(sprintf('Saving groups is not supported, please use the eZ Publish backend'));
127 127
 	}
128 128
 
129 129
 
@@ -136,33 +136,33 @@  discard block
 block discarded – undo
136 136
 	 * @return array List of items implementing \Aimeos\MShop\Customer\Item\Group\Iface
137 137
 	 * @throws \Aimeos\MShop\Exception If retrieving items failed
138 138
 	 */
139
-	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null )
139
+	public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null)
140 140
 	{
141 141
 		$map = [];
142 142
 		$context = $this->getContext();
143 143
 
144 144
 		$dbm = $context->getDatabaseManager();
145 145
 		$dbname = $this->getResourceName();
146
-		$conn = $dbm->acquire( $dbname );
146
+		$conn = $dbm->acquire($dbname);
147 147
 
148 148
 		try
149 149
 		{
150
-			$required = array( 'customer.group' );
150
+			$required = array('customer.group');
151 151
 			$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
152 152
 			$cfgPathSearch = 'mshop/customer/manager/group/ezpublish/search';
153 153
 			$cfgPathCount = 'mshop/customer/manager/group/ezpublish/count';
154 154
 
155
-			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
155
+			$results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level);
156 156
 
157
-			while( ( $row = $results->fetch() ) !== false ) {
158
-				$map[$row['customer.group.id']] = $this->createItemBase( $row );
157
+			while (($row = $results->fetch()) !== false) {
158
+				$map[$row['customer.group.id']] = $this->createItemBase($row);
159 159
 			}
160 160
 
161
-			$dbm->release( $conn, $dbname );
161
+			$dbm->release($conn, $dbname);
162 162
 		}
163
-		catch( \Exception $e )
163
+		catch (\Exception $e)
164 164
 		{
165
-			$dbm->release( $conn, $dbname );
165
+			$dbm->release($conn, $dbname);
166 166
 			throw $e;
167 167
 		}
168 168
 
Please login to merge, or discard this patch.
lib/custom/tests/TestHelper.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Address/Ezpublish.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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,11 +209,11 @@  discard block
 block discarded – undo
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 219
 
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
 	 *
224 224
 	 * @param array $ids List of IDs
225 225
 	 */
226
-	public function deleteItems( array $ids )
226
+	public function deleteItems(array $ids)
227 227
 	{
228
-		$this->deleteItemsBase( $ids, $this->getConfigPath() . 'delete', false );
228
+		$this->deleteItemsBase($ids, $this->getConfigPath().'delete', false);
229 229
 	}
230 230
 
231 231
 
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	 * @param boolean $withsub Return also attributes of sub-managers if true
236 236
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
237 237
 	 */
238
-	public function getSearchAttributes( $withsub = true )
238
+	public function getSearchAttributes($withsub = true)
239 239
 	{
240 240
 		$path = 'mshop/customer/manager/address/submanagers';
241 241
 
242
-		return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, [], $withsub );
242
+		return $this->getSearchAttributesBase($this->getSearchConfig(), $path, [], $withsub);
243 243
 	}
244 244
 
245 245
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
251 251
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
252 252
 	 */
253
-	public function getSubManager( $manager, $name = null )
253
+	public function getSubManager($manager, $name = null)
254 254
 	{
255
-		return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Ezpublish' : $name ) );
255
+		return $this->getSubManagerBase('customer', 'address/'.$manager, ($name === null ? 'Ezpublish' : $name));
256 256
 	}
257 257
 
258 258
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Lists/Type/Ezpublish.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
113 113
 	 * @param boolean $withsub Return also attributes of sub-managers if true
114 114
 	 * @return array List of attribute items 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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Lists/Ezpublish.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
150 150
 	 * @param boolean $withsub Return also attributes of sub-managers if true
151 151
 	 * @return array List of attribute items 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, array( 'type' ), $withsub );
157
+		return $this->getSearchAttributesBase($this->getSearchConfig(), $path, array('type'), $withsub);
158 158
 	}
159 159
 
160 160
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
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,18 +177,18 @@  discard block
 block discarded – undo
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 182
 		$iface = '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface';
183
-		if( !( $item instanceof $iface ) ) {
184
-			throw new \Aimeos\MShop\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
183
+		if (!($item instanceof $iface)) {
184
+			throw new \Aimeos\MShop\Exception(sprintf('Object is not of required type "%1$s"', $iface));
185 185
 		}
186 186
 
187
-		if( $item->getDomain() === 'customer/group' ) {
188
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) );
187
+		if ($item->getDomain() === 'customer/group') {
188
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Adding groups to customers is not supported, please use the eZ Publish backend'));
189 189
 		}
190 190
 
191
-		parent::saveItem( $item, $fetch );
191
+		parent::saveItem($item, $fetch);
192 192
 	}
193 193
 
194 194
 
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Property/EzpublishTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,47 +16,47 @@
 block discarded – undo
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( 'property', 'Ezpublish' );
19
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish');
20
+		$this->object = $manager->getSubManager('property', '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\MShop\Exception' );
60
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.property.type.' ) );
59
+		$this->setExpectedException('\Aimeos\MShop\Exception');
60
+		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.property.type.'));
61 61
 	}
62 62
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Property/Type/EzpublishTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,39 +16,39 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/custom/setup/default/schema/customer.php 1 patch
Spacing   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -8,176 +8,176 @@
 block discarded – undo
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( 'status', 'smallint', [] );
82
-			$table->addColumn( 'mtime', 'datetime', [] );
83
-			$table->addColumn( 'ctime', 'datetime', [] );
84
-			$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('status', 'smallint', []);
82
+			$table->addColumn('mtime', 'datetime', []);
83
+			$table->addColumn('ctime', 'datetime', []);
84
+			$table->addColumn('editor', 'string', array('length' => 255));
85 85
 
86
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' );
87
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' );
88
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' );
89
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' );
90
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' );
86
+			$table->setPrimaryKey(array('id'), 'pk_ezplity_id');
87
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code');
88
+			$table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status');
89
+			$table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label');
90
+			$table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code');
91 91
 
92 92
 			return $schema;
93 93
 		},
94 94
 
95
-		'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
96
-
97
-			$table = $schema->createTable( 'ezuser_list' );
98
-
99
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
100
-			$table->addColumn( 'parentid', 'integer', [] );
101
-			$table->addColumn( 'siteid', 'integer', [] );
102
-			$table->addColumn( 'typeid', 'integer', [] );
103
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
104
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
105
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
106
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
107
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
108
-			$table->addColumn( 'pos', 'integer', [] );
109
-			$table->addColumn( 'status', 'smallint', [] );
110
-			$table->addColumn( 'mtime', 'datetime', [] );
111
-			$table->addColumn( 'ctime', 'datetime', [] );
112
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
113
-
114
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' );
115
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' );
116
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' );
117
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' );
118
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' );
119
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' );
120
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' );
121
-
122
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
123
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' );
124
-
125
-			$table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ),
126
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' );
95
+		'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
96
+
97
+			$table = $schema->createTable('ezuser_list');
98
+
99
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
100
+			$table->addColumn('parentid', 'integer', []);
101
+			$table->addColumn('siteid', 'integer', []);
102
+			$table->addColumn('typeid', 'integer', []);
103
+			$table->addColumn('domain', 'string', array('length' => 32));
104
+			$table->addColumn('refid', 'string', array('length' => 32));
105
+			$table->addColumn('start', 'datetime', array('notnull' => false));
106
+			$table->addColumn('end', 'datetime', array('notnull' => false));
107
+			$table->addColumn('config', 'text', array('length' => 0xffff));
108
+			$table->addColumn('pos', 'integer', []);
109
+			$table->addColumn('status', 'smallint', []);
110
+			$table->addColumn('mtime', 'datetime', []);
111
+			$table->addColumn('ctime', 'datetime', []);
112
+			$table->addColumn('editor', 'string', array('length' => 255));
113
+
114
+			$table->setPrimaryKey(array('id'), 'pk_ezpli_id');
115
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid');
116
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end');
117
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid');
118
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start');
119
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end');
120
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos');
121
+
122
+			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'),
123
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid');
124
+
125
+			$table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'),
126
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid');
127 127
 
128 128
 			return $schema;
129 129
 		},
130 130
 
131
-		'ezuser_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
131
+		'ezuser_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
132 132
 
133
-			$table = $schema->createTable( 'ezuser_property_type' );
133
+			$table = $schema->createTable('ezuser_property_type');
134 134
 
135
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
136
-			$table->addColumn( 'siteid', 'integer', [] );
137
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
138
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
139
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
140
-			$table->addColumn( 'pos', 'integer', [] );
141
-			$table->addColumn( 'status', 'smallint', [] );
142
-			$table->addColumn( 'mtime', 'datetime', [] );
143
-			$table->addColumn( 'ctime', 'datetime', [] );
144
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
135
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
136
+			$table->addColumn('siteid', 'integer', []);
137
+			$table->addColumn('domain', 'string', array('length' => 32));
138
+			$table->addColumn('code', 'string', array('length' => 32));
139
+			$table->addColumn('label', 'string', array('length' => 255));
140
+			$table->addColumn('pos', 'integer', []);
141
+			$table->addColumn('status', 'smallint', []);
142
+			$table->addColumn('mtime', 'datetime', []);
143
+			$table->addColumn('ctime', 'datetime', []);
144
+			$table->addColumn('editor', 'string', array('length' => 255));
145 145
 
146
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpprty_id' );
147
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezpprty_sid_dom_code' );
148
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_ezpprty_sid_status_pos' );
149
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_ezpprty_sid_label' );
150
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_ezpprty_sid_code' );
146
+			$table->setPrimaryKey(array('id'), 'pk_ezpprty_id');
147
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezpprty_sid_dom_code');
148
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_ezpprty_sid_status_pos');
149
+			$table->addIndex(array('siteid', 'label'), 'idx_ezpprty_sid_label');
150
+			$table->addIndex(array('siteid', 'code'), 'idx_ezpprty_sid_code');
151 151
 
152 152
 			return $schema;
153 153
 		},
154 154
 
155
-		'ezuser_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
155
+		'ezuser_property' => function(\Doctrine\DBAL\Schema\Schema $schema) {
156 156
 
157
-			$table = $schema->createTable( 'ezuser_property' );
157
+			$table = $schema->createTable('ezuser_property');
158 158
 
159
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
160
-			$table->addColumn( 'siteid', 'integer', [] );
161
-			$table->addColumn( 'parentid', 'integer', [] );
162
-			$table->addColumn( 'typeid', 'integer', [] );
163
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
164
-			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
165
-			$table->addColumn( 'mtime', 'datetime', [] );
166
-			$table->addColumn( 'ctime', 'datetime', [] );
167
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
159
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
160
+			$table->addColumn('siteid', 'integer', []);
161
+			$table->addColumn('parentid', 'integer', []);
162
+			$table->addColumn('typeid', 'integer', []);
163
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
164
+			$table->addColumn('value', 'string', array('length' => 255));
165
+			$table->addColumn('mtime', 'datetime', []);
166
+			$table->addColumn('ctime', 'datetime', []);
167
+			$table->addColumn('editor', 'string', array('length' => 255));
168 168
 
169
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezppr_id' );
170
-			$table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_ezppr_sid_tid_lid_value' );
171
-			$table->addIndex( array( 'siteid', 'langid' ), 'idx_ezppr_sid_langid' );
172
-			$table->addIndex( array( 'siteid', 'value' ), 'idx_ezppr_sid_value' );
173
-			$table->addIndex( array( 'typeid' ), 'fk_ezppr_typeid' );
174
-			$table->addIndex( array( 'parentid' ), 'fk_ezppr_pid' );
169
+			$table->setPrimaryKey(array('id'), 'pk_ezppr_id');
170
+			$table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_ezppr_sid_tid_lid_value');
171
+			$table->addIndex(array('siteid', 'langid'), 'idx_ezppr_sid_langid');
172
+			$table->addIndex(array('siteid', 'value'), 'idx_ezppr_sid_value');
173
+			$table->addIndex(array('typeid'), 'fk_ezppr_typeid');
174
+			$table->addIndex(array('parentid'), 'fk_ezppr_pid');
175 175
 
176
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
177
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezppr_pid' );
176
+			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'),
177
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezppr_pid');
178 178
 
179
-			$table->addForeignKeyConstraint( 'ezuser_property_type', array( 'typeid' ), array( 'id' ),
180
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezppr_typeid' );
179
+			$table->addForeignKeyConstraint('ezuser_property_type', array('typeid'), array('id'),
180
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezppr_typeid');
181 181
 
182 182
 			return $schema;
183 183
 		},
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Ezpublish.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 	 *
229 229
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
230 230
 	 */
231
-	public function cleanup( array $siteids )
231
+	public function cleanup(array $siteids)
232 232
 	{
233 233
 		$path = 'mshop/customer/manager/submanagers';
234
-		foreach( $this->getContext()->getConfig()->get( $path, ['address', 'group', 'lists', 'property'] ) as $domain ) {
235
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
234
+		foreach ($this->getContext()->getConfig()->get($path, ['address', 'group', 'lists', 'property']) as $domain) {
235
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
236 236
 		}
237 237
 	}
238 238
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 	 *
254 254
 	 * @param array $ids List of IDs
255 255
 	 */
256
-	public function deleteItems( array $ids )
256
+	public function deleteItems(array $ids)
257 257
 	{
258 258
 		$service = $this->getContext()->getEzUserService();
259 259
 
260
-		foreach( $ids as $id ) {
261
-			$service->deleteUser( $service->loadUser( $id ) );
260
+		foreach ($ids as $id) {
261
+			$service->deleteUser($service->loadUser($id));
262 262
 		}
263 263
 	}
264 264
 
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 	 * @param boolean $withsub Return also attributes of sub-managers if true
270 270
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
271 271
 	 */
272
-	public function getSearchAttributes( $withsub = true )
272
+	public function getSearchAttributes($withsub = true)
273 273
 	{
274 274
 		$path = 'mshop/customer/manager/submanagers';
275 275
 
276
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, ['address', 'group', 'lists', 'property'], $withsub );
276
+		return $this->getSearchAttributesBase($this->searchConfig, $path, ['address', 'group', 'lists', 'property'], $withsub);
277 277
 	}
278 278
 
279 279
 
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
285 285
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
286 286
 	 */
287
-	public function getSubManager( $manager, $name = null )
287
+	public function getSubManager($manager, $name = null)
288 288
 	{
289
-		return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Ezpublish' : $name ) );
289
+		return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Ezpublish' : $name));
290 290
 	}
291 291
 
292 292
 
@@ -297,99 +297,99 @@  discard block
 block discarded – undo
297 297
 	 * @param boolean $fetch True if the new ID should be returned in the item
298 298
 	 * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID
299 299
 	 */
300
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
300
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
301 301
 	{
302 302
 		$iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface';
303
-		if( !( $item instanceof $iface ) ) {
304
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
303
+		if (!($item instanceof $iface)) {
304
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface));
305 305
 		}
306 306
 
307
-		if( !$item->isModified() )
307
+		if (!$item->isModified())
308 308
 		{
309
-			$item = $this->savePropertyItems( $item, 'customer' );
310
-			$item = $this->saveAddressItems( $item, 'customer' );
311
-			return $this->saveListItems( $item, 'customer' );
309
+			$item = $this->savePropertyItems($item, 'customer');
310
+			$item = $this->saveAddressItems($item, 'customer');
311
+			return $this->saveListItems($item, 'customer');
312 312
 		}
313 313
 
314 314
 		$context = $this->getContext();
315 315
 
316 316
 		$class = '\Aimeos\MShop\Context\Item\Ezpublish';
317
-		if( !is_a( $context, $class ) ) {
318
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $class ) );
317
+		if (!is_a($context, $class)) {
318
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $class));
319 319
 		}
320 320
 
321 321
 		$service = $context->getEzUserService();
322 322
 		$email = $item->getPaymentAddress()->getEmail();
323 323
 
324
-		if( $item->getId() !== null )
324
+		if ($item->getId() !== null)
325 325
 		{
326 326
 			$struct = $service->newUserUpdateStruct();
327 327
 			$struct->password = $item->getPassword();
328 328
 			$struct->enabled = $item->getStatus();
329 329
 			$struct->email = $email;
330 330
 
331
-			$user = $service->loadUser( $item->getId() );
332
-			$service->updateUser( $user, $struct );
331
+			$user = $service->loadUser($item->getId());
332
+			$service->updateUser($user, $struct);
333 333
 		}
334 334
 		else
335 335
 		{
336
-			$struct = $service->newUserCreateStruct( $item->getCode(), $email, $item->getPassword(), 'eng-GB' );
336
+			$struct = $service->newUserCreateStruct($item->getCode(), $email, $item->getPassword(), 'eng-GB');
337 337
 			$struct->enabled = $item->getStatus();
338 338
 
339
-			$user = $service->createUser( $struct, [] );
340
-			$item->setId( $user->getUserId() );
339
+			$user = $service->createUser($struct, []);
340
+			$item->setId($user->getUserId());
341 341
 		}
342 342
 
343 343
 		$dbm = $context->getDatabaseManager();
344 344
 		$dbname = $this->getResourceName();
345
-		$conn = $dbm->acquire( $dbname );
345
+		$conn = $dbm->acquire($dbname);
346 346
 
347 347
 		try
348 348
 		{
349
-			$date = date( 'Y-m-d H:i:s' );
350
-			$ctime = ( $item->getTimeCreated() ? $item->getTimeCreated() : $date );
349
+			$date = date('Y-m-d H:i:s');
350
+			$ctime = ($item->getTimeCreated() ? $item->getTimeCreated() : $date);
351 351
 			$billingAddress = $item->getPaymentAddress();
352 352
 
353 353
 			$path = 'mshop/customer/manager/ezpublish/update';
354
-			$stmt = $this->getCachedStatement( $conn, $path );
355
-
356
-			$stmt->bind( 1, $billingAddress->getCompany() );
357
-			$stmt->bind( 2, $billingAddress->getVatID() );
358
-			$stmt->bind( 3, $billingAddress->getSalutation() );
359
-			$stmt->bind( 4, $billingAddress->getTitle() );
360
-			$stmt->bind( 5, $billingAddress->getFirstname() );
361
-			$stmt->bind( 6, $billingAddress->getLastname() );
362
-			$stmt->bind( 7, $billingAddress->getAddress1() );
363
-			$stmt->bind( 8, $billingAddress->getAddress2() );
364
-			$stmt->bind( 9, $billingAddress->getAddress3() );
365
-			$stmt->bind( 10, $billingAddress->getPostal() );
366
-			$stmt->bind( 11, $billingAddress->getCity() );
367
-			$stmt->bind( 12, $billingAddress->getState() );
368
-			$stmt->bind( 13, $billingAddress->getCountryId() );
369
-			$stmt->bind( 14, $billingAddress->getLanguageId() );
370
-			$stmt->bind( 15, $billingAddress->getTelephone() );
371
-			$stmt->bind( 16, $billingAddress->getTelefax() );
372
-			$stmt->bind( 17, $billingAddress->getWebsite() );
373
-			$stmt->bind( 18, $item->getBirthday() );
374
-			$stmt->bind( 19, $item->getDateVerified() );
375
-			$stmt->bind( 20, $date ); // Modification time
376
-			$stmt->bind( 21, $context->getEditor() );
377
-			$stmt->bind( 22, $ctime ); // Creation time
378
-			$stmt->bind( 23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT );
354
+			$stmt = $this->getCachedStatement($conn, $path);
355
+
356
+			$stmt->bind(1, $billingAddress->getCompany());
357
+			$stmt->bind(2, $billingAddress->getVatID());
358
+			$stmt->bind(3, $billingAddress->getSalutation());
359
+			$stmt->bind(4, $billingAddress->getTitle());
360
+			$stmt->bind(5, $billingAddress->getFirstname());
361
+			$stmt->bind(6, $billingAddress->getLastname());
362
+			$stmt->bind(7, $billingAddress->getAddress1());
363
+			$stmt->bind(8, $billingAddress->getAddress2());
364
+			$stmt->bind(9, $billingAddress->getAddress3());
365
+			$stmt->bind(10, $billingAddress->getPostal());
366
+			$stmt->bind(11, $billingAddress->getCity());
367
+			$stmt->bind(12, $billingAddress->getState());
368
+			$stmt->bind(13, $billingAddress->getCountryId());
369
+			$stmt->bind(14, $billingAddress->getLanguageId());
370
+			$stmt->bind(15, $billingAddress->getTelephone());
371
+			$stmt->bind(16, $billingAddress->getTelefax());
372
+			$stmt->bind(17, $billingAddress->getWebsite());
373
+			$stmt->bind(18, $item->getBirthday());
374
+			$stmt->bind(19, $item->getDateVerified());
375
+			$stmt->bind(20, $date); // Modification time
376
+			$stmt->bind(21, $context->getEditor());
377
+			$stmt->bind(22, $ctime); // Creation time
378
+			$stmt->bind(23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT);
379 379
 
380 380
 			$stmt->execute()->finish();
381 381
 
382
-			$dbm->release( $conn, $dbname );
382
+			$dbm->release($conn, $dbname);
383 383
 		}
384
-		catch( \Exception $e )
384
+		catch (\Exception $e)
385 385
 		{
386
-			$dbm->release( $conn, $dbname );
386
+			$dbm->release($conn, $dbname);
387 387
 			throw $e;
388 388
 		}
389 389
 
390
-		$item = $this->savePropertyItems( $item, 'customer' );
391
-		$item = $this->saveAddressItems( $item, 'customer' );
392
-		return $this->saveListItems( $item, 'customer' );
390
+		$item = $this->savePropertyItems($item, 'customer');
391
+		$item = $this->saveAddressItems($item, 'customer');
392
+		return $this->saveListItems($item, 'customer');
393 393
 	}
394 394
 
395 395
 
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 	 * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface
402 402
 	 * @throws \Aimeos\MShop\Customer\Exception If creating items failed
403 403
 	 */
404
-	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null )
404
+	public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null)
405 405
 	{
406 406
 		$dbm = $this->getContext()->getDatabaseManager();
407 407
 		$dbname = $this->getResourceName();
408
-		$conn = $dbm->acquire( $dbname );
408
+		$conn = $dbm->acquire($dbname);
409 409
 		$map = [];
410 410
 
411 411
 		try
@@ -413,34 +413,34 @@  discard block
 block discarded – undo
413 413
 			$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
414 414
 			$cfgPathSearch = 'mshop/customer/manager/ezpublish/search';
415 415
 			$cfgPathCount = 'mshop/customer/manager/ezpublish/count';
416
-			$required = array( 'customer' );
416
+			$required = array('customer');
417 417
 
418
-			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
418
+			$results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level);
419 419
 
420
-			while( ( $row = $results->fetch() ) !== false )
420
+			while (($row = $results->fetch()) !== false)
421 421
 			{
422
-				$map[ $row['customer.id'] ] = $row;
423
-				$map[ $row['customer.id'] ]['groups'] = [];
422
+				$map[$row['customer.id']] = $row;
423
+				$map[$row['customer.id']]['groups'] = [];
424 424
 			}
425 425
 
426 426
 
427 427
 			$path = 'mshop/customer/manager/ezpublish/groups';
428
-			$stmt = $conn->create( $this->getGroupSql( array_keys( $map ), $path ) );
428
+			$stmt = $conn->create($this->getGroupSql(array_keys($map), $path));
429 429
 			$results = $stmt->execute();
430 430
 
431
-			while( ( $row = $results->fetch() ) !== false ) {
432
-				$map[ $row['contentobject_id'] ]['groups'][] = $row['role_id'];
431
+			while (($row = $results->fetch()) !== false) {
432
+				$map[$row['contentobject_id']]['groups'][] = $row['role_id'];
433 433
 			}
434 434
 
435
-			$dbm->release( $conn, $dbname );
435
+			$dbm->release($conn, $dbname);
436 436
 		}
437
-		catch( \Exception $e )
437
+		catch (\Exception $e)
438 438
 		{
439
-			$dbm->release( $conn, $dbname  );
439
+			$dbm->release($conn, $dbname);
440 440
 			throw $e;
441 441
 		}
442 442
 
443
-		return $this->buildItems( $map, $ref, 'customer' );
443
+		return $this->buildItems($map, $ref, 'customer');
444 444
 	}
445 445
 
446 446
 
@@ -453,15 +453,15 @@  discard block
 block discarded – undo
453 453
 	 * @param array $addresses List of address items of the customer item
454 454
 	 * @return \Aimeos\MShop\Customer\Item\Iface New customer item
455 455
 	 */
456
-	protected function createItemBase( array $values = [], array $listItems = [], array $refItems = [], array $addresses = [], array $propItems = [] )
456
+	protected function createItemBase(array $values = [], array $listItems = [], array $refItems = [], array $addresses = [], array $propItems = [])
457 457
 	{
458
-		if( !isset( $this->addressManager ) ) {
459
-			$this->addressManager = $this->getObject()->getSubManager( 'address' );
458
+		if (!isset($this->addressManager)) {
459
+			$this->addressManager = $this->getObject()->getSubManager('address');
460 460
 		}
461 461
 
462 462
 		$address = $this->addressManager->createItem();
463 463
 
464
-		return new \Aimeos\MShop\Customer\Item\Ezpublish( $address, $values, $listItems, $refItems, $addresses, $propItems );
464
+		return new \Aimeos\MShop\Customer\Item\Ezpublish($address, $values, $listItems, $refItems, $addresses, $propItems);
465 465
 	}
466 466
 
467 467
 
@@ -472,18 +472,18 @@  discard block
 block discarded – undo
472 472
 	 * @param string $cfgpath Configuration path to the SQL statement
473 473
 	 * @return string SQL statement ready for execution
474 474
 	 */
475
-	protected function getGroupSql( array $ids, $cfgpath )
475
+	protected function getGroupSql(array $ids, $cfgpath)
476 476
 	{
477
-		if( empty( $ids ) ) { return '1=1'; }
477
+		if (empty($ids)) { return '1=1'; }
478 478
 
479 479
 		$search = $this->getObject()->createSearch();
480
-		$search->setConditions( $search->compare( '==', 'id', $ids ) );
480
+		$search->setConditions($search->compare('==', 'id', $ids));
481 481
 
482
-		$types = array( 'id' => \Aimeos\MW\DB\Statement\Base::PARAM_INT );
483
-		$translations = array( 'id' => '"contentobject_id"' );
482
+		$types = array('id' => \Aimeos\MW\DB\Statement\Base::PARAM_INT);
483
+		$translations = array('id' => '"contentobject_id"');
484 484
 
485
-		$cond = $search->getConditionString( $types, $translations );
485
+		$cond = $search->getConditionString($types, $translations);
486 486
 
487
-		return str_replace( ':cond', $cond, $this->getSqlConfig( $cfgpath ) );
487
+		return str_replace(':cond', $cond, $this->getSqlConfig($cfgpath));
488 488
 	}
489 489
 }
Please login to merge, or discard this patch.