Completed
Push — master ( 14fb88...d9b4a5 )
by Aimeos
04:22
created
lib/custom/setup/unittest/CustomerPropertyAddFosUserTestData.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	public function getPreDependencies()
25 25
 	{
26
-		return array( 'TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData' );
26
+		return array('TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData');
27 27
 	}
28 28
 
29 29
 
@@ -33,22 +33,22 @@  discard block
 block discarded – undo
33 33
 	public function migrate()
34 34
 	{
35 35
 		$iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
36
-		if( !( $this->additional instanceof $iface ) ) {
37
-			throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
36
+		if (!($this->additional instanceof $iface)) {
37
+			throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface));
38 38
 		}
39 39
 
40
-		$this->msg( 'Adding customer property Fos user bundle test data', 0 );
41
-		$this->additional->setEditor( 'ai-fosuser:unittest' );
40
+		$this->msg('Adding customer property Fos user bundle test data', 0);
41
+		$this->additional->setEditor('ai-fosuser:unittest');
42 42
 
43 43
 		$ds = DIRECTORY_SEPARATOR;
44 44
 		$path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php';
45 45
 
46
-		if( ( $testdata = include( $path ) ) == false ) {
47
-			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
46
+		if (($testdata = include($path)) == false) {
47
+			throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path));
48 48
 		}
49 49
 
50
-		$this->addCustomerPropertyData( $testdata, 'FosUser' );
50
+		$this->addCustomerPropertyData($testdata, 'FosUser');
51 51
 
52
-		$this->status( 'done' );
52
+		$this->status('done');
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Item/FosUser.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	 * @param \Aimeos\MShop\Common\Item\Iface[] $refItems List of referenced items
33 33
 	 * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object
34 34
 	 */
35
-	public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address,
35
+	public function __construct(\Aimeos\MShop\Common\Item\Address\Iface $address,
36 36
 		array $values = [], array $listItems = [], array $refItems = [], $salt = '',
37
-		\Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null, array $addresses = [], array $propItems = [] )
37
+		\Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null, array $addresses = [], array $propItems = [])
38 38
 	{
39
-		parent::__construct( $address, $values, $listItems, $refItems, $salt, $helper, $addresses, $propItems, $propItems );
39
+		parent::__construct($address, $values, $listItems, $refItems, $salt, $helper, $addresses, $propItems, $propItems);
40 40
 
41 41
 		$this->values = $values;
42 42
 		$this->helper = $helper;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function getPassword()
53 53
 	{
54
-		if( isset( $this->values['customer.password'] ) ) {
54
+		if (isset($this->values['customer.password'])) {
55 55
 			return (string) $this->values['customer.password'];
56 56
 		}
57 57
 
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @param string $value Password of the customer item
66 66
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
67 67
 	 */
68
-	public function setPassword( $value )
68
+	public function setPassword($value)
69 69
 	{
70
-		if( (string) $value !== $this->getPassword() )
70
+		if ((string) $value !== $this->getPassword())
71 71
 		{
72
-			if( $this->helper !== null ) {
73
-				$value = $this->helper->encode( $value, $this->getSalt() );
72
+			if ($this->helper !== null) {
73
+				$value = $this->helper->encode($value, $this->getSalt());
74 74
 			}
75 75
 
76 76
 			$this->values['customer.password'] = (string) $value;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function getRoles()
90 90
 	{
91
-		if( isset( $this->values['roles'] ) ) {
91
+		if (isset($this->values['roles'])) {
92 92
 			return (array) $this->values['roles'];
93 93
 		}
94 94
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @param array $roles List of Symfony roles
103 103
 	 */
104
-	public function setRoles( array $roles )
104
+	public function setRoles(array $roles)
105 105
 	{
106 106
 		$this->values['roles'] = $roles;
107 107
 		$this->setModified();
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function getSalt()
119 119
 	{
120
-		if( isset( $this->values['salt'] ) ) {
120
+		if (isset($this->values['salt'])) {
121 121
 			return $this->values['salt'];
122 122
 		}
123 123
 
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @param string $value Password salt
132 132
 	 */
133
-	public function setSalt( $value )
133
+	public function setSalt($value)
134 134
 	{
135
-		if( (string) $value !== $this->getSalt() )
135
+		if ((string) $value !== $this->getSalt())
136 136
 		{
137 137
 			$this->values['salt'] = (string) $value;
138 138
 			$this->setModified();
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/FosUserTest.php 1 patch
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
21 21
 	{
22 22
 		$context = \TestHelper::getContext();
23 23
 		$this->editor = $context->getEditor();
24
-		$this->object = new \Aimeos\MShop\Customer\Manager\FosUser( $context );
24
+		$this->object = new \Aimeos\MShop\Customer\Manager\FosUser($context);
25 25
 
26 26
 		$this->fixture = array(
27 27
 			'label' => 'unitTest',
28 28
 			'status' => 2,
29 29
 		);
30 30
 
31
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
31
+		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.');
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->fixture, $this->address );
37
+		unset($this->object, $this->fixture, $this->address);
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testCleanup()
42 42
 	{
43
-		$this->object->cleanup( array( -1 ) );
43
+		$this->object->cleanup(array( -1 ));
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testGetSearchAttributes()
48 48
 	{
49
-		foreach( $this->object->getSearchAttributes() as $attribute )
49
+		foreach ($this->object->getSearchAttributes() as $attribute)
50 50
 		{
51
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
51
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
52 52
 		}
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testCreateItem()
57 57
 	{
58
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() );
58
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem());
59 59
 	}
60 60
 
61 61
 
@@ -63,21 +63,21 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$search = $this->object->createSearch();
65 65
 		$conditions = array(
66
-			$search->compare( '==', 'customer.code', 'UTC003' ),
67
-			$search->compare( '==', 'customer.editor', $this->editor )
66
+			$search->compare('==', 'customer.code', 'UTC003'),
67
+			$search->compare('==', 'customer.editor', $this->editor)
68 68
 		);
69
-		$search->setConditions( $search->combine( '&&', $conditions ) );
70
-		$items = $this->object->searchItems( $search, array( 'text' ) );
69
+		$search->setConditions($search->combine('&&', $conditions));
70
+		$items = $this->object->searchItems($search, array('text'));
71 71
 
72
-		if( ( $expected = reset( $items ) ) === false ) {
73
-			throw new \RuntimeException( 'No customer item with code "UTC003" found' );
72
+		if (($expected = reset($items)) === false) {
73
+			throw new \RuntimeException('No customer item with code "UTC003" found');
74 74
 		}
75 75
 
76
-		$actual = $this->object->getItem( $expected->getId(), array( 'text' ) );
76
+		$actual = $this->object->getItem($expected->getId(), array('text'));
77 77
 
78
-		$this->assertEquals( $expected, $actual );
79
-		$this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) );
80
-		$this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) );
78
+		$this->assertEquals($expected, $actual);
79
+		$this->assertEquals(3, count($actual->getListItems('text')));
80
+		$this->assertEquals(3, count($actual->getRefItems('text')));
81 81
 	}
82 82
 
83 83
 
@@ -85,96 +85,96 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		$item = $this->object->createItem();
87 87
 
88
-		$item->setCode( 'unitTest' );
89
-		$item->setLabel( 'unitTest' );
90
-		$resultSaved = $this->object->saveItem( $item );
91
-		$itemSaved = $this->object->getItem( $item->getId() );
88
+		$item->setCode('unitTest');
89
+		$item->setLabel('unitTest');
90
+		$resultSaved = $this->object->saveItem($item);
91
+		$itemSaved = $this->object->getItem($item->getId());
92 92
 
93 93
 		$itemExp = clone $itemSaved;
94
-		$itemExp->setCode( 'unitTest2' );
95
-		$itemExp->setLabel( 'unitTest2' );
96
-		$resultUpd = $this->object->saveItem( $itemExp );
97
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
98
-
99
-		$this->object->deleteItem( $item->getId() );
100
-
101
-		$this->assertTrue( $item->getId() !== null );
102
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
103
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
104
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
105
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
106
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
107
-		$this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() );
108
-		$this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() );
109
-		$this->assertEquals( $item->getPassword(), $itemSaved->getPassword() );
110
-		$this->assertEquals( $item->getRoles(), $itemSaved->getRoles() );
111
-		$this->assertEquals( $item->getSalt(), $itemSaved->getSalt() );
112
-
113
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
114
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
115
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
116
-
117
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
118
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
119
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
120
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
121
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
122
-		$this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() );
123
-		$this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() );
124
-		$this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() );
125
-		$this->assertEquals( $itemExp->getRoles(), $itemUpd->getRoles() );
126
-		$this->assertEquals( $itemExp->getSalt(), $itemUpd->getSalt() );
127
-
128
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
129
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
130
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
131
-
132
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
133
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
134
-
135
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
136
-		$this->object->getItem( $item->getId() );
94
+		$itemExp->setCode('unitTest2');
95
+		$itemExp->setLabel('unitTest2');
96
+		$resultUpd = $this->object->saveItem($itemExp);
97
+		$itemUpd = $this->object->getItem($itemExp->getId());
98
+
99
+		$this->object->deleteItem($item->getId());
100
+
101
+		$this->assertTrue($item->getId() !== null);
102
+		$this->assertEquals($item->getId(), $itemSaved->getId());
103
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
104
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
105
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
106
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
107
+		$this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress());
108
+		$this->assertEquals($item->getBirthday(), $itemSaved->getBirthday());
109
+		$this->assertEquals($item->getPassword(), $itemSaved->getPassword());
110
+		$this->assertEquals($item->getRoles(), $itemSaved->getRoles());
111
+		$this->assertEquals($item->getSalt(), $itemSaved->getSalt());
112
+
113
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
114
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
115
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
116
+
117
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
118
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
119
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
120
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
121
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
122
+		$this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress());
123
+		$this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday());
124
+		$this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword());
125
+		$this->assertEquals($itemExp->getRoles(), $itemUpd->getRoles());
126
+		$this->assertEquals($itemExp->getSalt(), $itemUpd->getSalt());
127
+
128
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
129
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
130
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
131
+
132
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
133
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
134
+
135
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
136
+		$this->object->getItem($item->getId());
137 137
 	}
138 138
 
139 139
 
140 140
 	public function testGetSaveAddressItems()
141 141
 	{
142
-		$item = $this->object->findItem( 'UTC001', ['customer/address'] );
142
+		$item = $this->object->findItem('UTC001', ['customer/address']);
143 143
 
144
-		$item->setId( null )->setCode( 'xyz' );
145
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
146
-		$item->addAddressItem( new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.' ) );
147
-		$this->object->saveItem( $item );
144
+		$item->setId(null)->setCode('xyz');
145
+		$item->getPaymentAddress()->setEmail('[email protected]');
146
+		$item->addAddressItem(new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.'));
147
+		$this->object->saveItem($item);
148 148
 
149
-		$item2 = $this->object->findItem( 'xyz', ['customer/address'] );
149
+		$item2 = $this->object->findItem('xyz', ['customer/address']);
150 150
 
151
-		$this->object->deleteItem( $item->getId() );
151
+		$this->object->deleteItem($item->getId());
152 152
 
153
-		$this->assertEquals( 2, count( $item->getAddressItems() ) );
154
-		$this->assertEquals( 2, count( $item2->getAddressItems() ) );
153
+		$this->assertEquals(2, count($item->getAddressItems()));
154
+		$this->assertEquals(2, count($item2->getAddressItems()));
155 155
 	}
156 156
 
157 157
 
158 158
 	public function testGetSavePropertyItems()
159 159
 	{
160
-		$item = $this->object->findItem( 'UTC001', ['customer/property'] );
160
+		$item = $this->object->findItem('UTC001', ['customer/property']);
161 161
 
162
-		$item->setId( null )->setCode( 'xyz' );
163
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
164
-		$this->object->saveItem( $item );
162
+		$item->setId(null)->setCode('xyz');
163
+		$item->getPaymentAddress()->setEmail('[email protected]');
164
+		$this->object->saveItem($item);
165 165
 
166
-		$item2 = $this->object->findItem( 'xyz', ['customer/property'] );
166
+		$item2 = $this->object->findItem('xyz', ['customer/property']);
167 167
 
168
-		$this->object->deleteItem( $item->getId() );
168
+		$this->object->deleteItem($item->getId());
169 169
 
170
-		$this->assertEquals( 1, count( $item->getPropertyItems() ) );
171
-		$this->assertEquals( 1, count( $item2->getPropertyItems() ) );
170
+		$this->assertEquals(1, count($item->getPropertyItems()));
171
+		$this->assertEquals(1, count($item2->getPropertyItems()));
172 172
 	}
173 173
 
174 174
 
175 175
 	public function testCreateSearch()
176 176
 	{
177
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
177
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
178 178
 	}
179 179
 
180 180
 
@@ -184,69 +184,69 @@  discard block
 block discarded – undo
184 184
 		$search = $this->object->createSearch();
185 185
 
186 186
 		$expr = [];
187
-		$expr[] = $search->compare( '!=', 'customer.id', null );
188
-		$expr[] = $search->compare( '==', 'customer.label', 'UTC002' );
189
-		$expr[] = $search->compare( '==', 'customer.code', 'UTC002' );
190
-
191
-		$expr[] = $search->compare( '>=', 'customer.salutation', '' );
192
-		$expr[] = $search->compare( '>=', 'customer.company', '' );
193
-		$expr[] = $search->compare( '>=', 'customer.vatid', '' );
194
-		$expr[] = $search->compare( '>=', 'customer.title', '' );
195
-		$expr[] = $search->compare( '>=', 'customer.firstname', '' );
196
-		$expr[] = $search->compare( '>=', 'customer.lastname', '' );
197
-		$expr[] = $search->compare( '>=', 'customer.address1', '' );
198
-		$expr[] = $search->compare( '>=', 'customer.address2', '' );
199
-		$expr[] = $search->compare( '>=', 'customer.address3', '' );
200
-		$expr[] = $search->compare( '>=', 'customer.postal', '' );
201
-		$expr[] = $search->compare( '>=', 'customer.city', '' );
202
-		$expr[] = $search->compare( '>=', 'customer.state', '' );
203
-		$expr[] = $search->compare( '!=', 'customer.languageid', null );
204
-		$expr[] = $search->compare( '>=', 'customer.countryid', '' );
205
-		$expr[] = $search->compare( '>=', 'customer.telephone', '' );
206
-		$expr[] = $search->compare( '>=', 'customer.email', '' );
207
-		$expr[] = $search->compare( '>=', 'customer.telefax', '' );
208
-		$expr[] = $search->compare( '>=', 'customer.website', '' );
209
-		$expr[] = $search->compare( '>=', 'customer.longitude', '10.0' );
210
-		$expr[] = $search->compare( '>=', 'customer.latitude', '50.0' );
211
-
212
-		$expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' );
213
-		$expr[] = $search->compare( '>=', 'customer.password', '' );
214
-		$expr[] = $search->compare( '==', 'customer.status', 0 );
215
-		$expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' );
216
-		$expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' );
217
-		$expr[] = $search->compare( '==', 'customer.editor', $this->editor );
218
-
219
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
220
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
221
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
222
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
223
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
224
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
225
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
226
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
227
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
228
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
229
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
230
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
231
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
232
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
233
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
234
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
235
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
236
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
237
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
238
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
239
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
240
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
241
-		$expr[] = $search->compare( '==', 'customer.address.flag', 0 );
242
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
243
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
244
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
245
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
246
-
247
-		$search->setConditions( $search->combine( '&&', $expr ) );
248
-		$result = $this->object->searchItems( $search, [], $total );
249
-		$this->assertEquals( 1, count( $result ) );
187
+		$expr[] = $search->compare('!=', 'customer.id', null);
188
+		$expr[] = $search->compare('==', 'customer.label', 'UTC002');
189
+		$expr[] = $search->compare('==', 'customer.code', 'UTC002');
190
+
191
+		$expr[] = $search->compare('>=', 'customer.salutation', '');
192
+		$expr[] = $search->compare('>=', 'customer.company', '');
193
+		$expr[] = $search->compare('>=', 'customer.vatid', '');
194
+		$expr[] = $search->compare('>=', 'customer.title', '');
195
+		$expr[] = $search->compare('>=', 'customer.firstname', '');
196
+		$expr[] = $search->compare('>=', 'customer.lastname', '');
197
+		$expr[] = $search->compare('>=', 'customer.address1', '');
198
+		$expr[] = $search->compare('>=', 'customer.address2', '');
199
+		$expr[] = $search->compare('>=', 'customer.address3', '');
200
+		$expr[] = $search->compare('>=', 'customer.postal', '');
201
+		$expr[] = $search->compare('>=', 'customer.city', '');
202
+		$expr[] = $search->compare('>=', 'customer.state', '');
203
+		$expr[] = $search->compare('!=', 'customer.languageid', null);
204
+		$expr[] = $search->compare('>=', 'customer.countryid', '');
205
+		$expr[] = $search->compare('>=', 'customer.telephone', '');
206
+		$expr[] = $search->compare('>=', 'customer.email', '');
207
+		$expr[] = $search->compare('>=', 'customer.telefax', '');
208
+		$expr[] = $search->compare('>=', 'customer.website', '');
209
+		$expr[] = $search->compare('>=', 'customer.longitude', '10.0');
210
+		$expr[] = $search->compare('>=', 'customer.latitude', '50.0');
211
+
212
+		$expr[] = $search->compare('==', 'customer.birthday', '1970-01-01');
213
+		$expr[] = $search->compare('>=', 'customer.password', '');
214
+		$expr[] = $search->compare('==', 'customer.status', 0);
215
+		$expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00');
216
+		$expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00');
217
+		$expr[] = $search->compare('==', 'customer.editor', $this->editor);
218
+
219
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
220
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
221
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
222
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
223
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
224
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
225
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
226
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
227
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
228
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
229
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
230
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
231
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
232
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
233
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
234
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
235
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
236
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
237
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
238
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
239
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
240
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
241
+		$expr[] = $search->compare('==', 'customer.address.flag', 0);
242
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
243
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
244
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
245
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
246
+
247
+		$search->setConditions($search->combine('&&', $expr));
248
+		$result = $this->object->searchItems($search, [], $total);
249
+		$this->assertEquals(1, count($result));
250 250
 	}
251 251
 
252 252
 
@@ -255,60 +255,60 @@  discard block
 block discarded – undo
255 255
 		$total = 0;
256 256
 
257 257
 		$search = $this->object->createSearch();
258
-		$search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) );
259
-		$search->setSlice( 0, 2 );
258
+		$search->setConditions($search->compare('==', 'customer.address.editor', $this->editor));
259
+		$search->setSlice(0, 2);
260 260
 
261
-		$results = $this->object->searchItems( $search, [], $total );
262
-		$this->assertEquals( 2, count( $results ) );
263
-		$this->assertEquals( 3, $total );
261
+		$results = $this->object->searchItems($search, [], $total);
262
+		$this->assertEquals(2, count($results));
263
+		$this->assertEquals(3, $total);
264 264
 
265
-		foreach($results as $itemId => $item) {
266
-			$this->assertEquals( $itemId, $item->getId() );
265
+		foreach ($results as $itemId => $item) {
266
+			$this->assertEquals($itemId, $item->getId());
267 267
 		}
268 268
 	}
269 269
 
270 270
 
271 271
 	public function testSearchItemsCriteria()
272 272
 	{
273
-		$search = $this->object->createSearch( true );
273
+		$search = $this->object->createSearch(true);
274 274
 		$conditions = array(
275
-			$search->compare( '==', 'customer.address.editor', $this->editor ),
275
+			$search->compare('==', 'customer.address.editor', $this->editor),
276 276
 			$search->getConditions()
277 277
 		);
278
-		$search->setConditions( $search->combine( '&&', $conditions ) );
279
-		$this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) );
278
+		$search->setConditions($search->combine('&&', $conditions));
279
+		$this->assertEquals(2, count($this->object->searchItems($search, [], $total)));
280 280
 	}
281 281
 
282 282
 
283 283
 	public function testSearchItemsRef()
284 284
 	{
285 285
 		$search = $this->object->createSearch();
286
-		$search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) );
286
+		$search->setConditions($search->compare('==', 'customer.code', 'UTC001'));
287 287
 
288
-		$results = $this->object->searchItems( $search, ['customer/address', 'text'] );
288
+		$results = $this->object->searchItems($search, ['customer/address', 'text']);
289 289
 
290
-		if( ( $item = reset( $results ) ) === false ) {
291
-			throw new \Exception( 'No customer item for "UTC001" available' );
290
+		if (($item = reset($results)) === false) {
291
+			throw new \Exception('No customer item for "UTC001" available');
292 292
 		}
293 293
 
294
-		$this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) );
295
-		$this->assertEquals( 1, count( $item->getAddressItems() ) );
294
+		$this->assertEquals(1, count($item->getRefItems('text')));
295
+		$this->assertEquals(1, count($item->getAddressItems()));
296 296
 	}
297 297
 
298 298
 
299 299
 	public function testGetSubManager()
300 300
 	{
301
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) );
302
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
301
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address'));
302
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard'));
303 303
 
304
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
305
-		$this->object->getSubManager( 'unknown' );
304
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
305
+		$this->object->getSubManager('unknown');
306 306
 	}
307 307
 
308 308
 
309 309
 	public function testGetSubManagerInvalidName()
310 310
 	{
311
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
312
-		$this->object->getSubManager( 'address', 'unknown' );
311
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
312
+		$this->object->getSubManager('address', 'unknown');
313 313
 	}
314 314
 }
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/FosUser.php 1 patch
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -243,13 +243,13 @@  discard block
 block discarded – undo
243 243
 	 *
244 244
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
245 245
 	 */
246
-	public function cleanup( array $siteids )
246
+	public function cleanup(array $siteids)
247 247
 	{
248 248
 		$path = 'mshop/customer/manager/submanagers';
249 249
 		$default = ['address', 'group', 'lists', 'property'];
250 250
 
251
-		foreach( $this->getContext()->getConfig()->get( $path, $default ) as $domain ) {
252
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
251
+		foreach ($this->getContext()->getConfig()->get($path, $default) as $domain) {
252
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
253 253
 		}
254 254
 	}
255 255
 
@@ -259,10 +259,10 @@  discard block
 block discarded – undo
259 259
 	 *
260 260
 	 * @param array $ids List of IDs
261 261
 	 */
262
-	public function deleteItems( array $ids )
262
+	public function deleteItems(array $ids)
263 263
 	{
264 264
 		$path = 'mshop/customer/manager/fosuser/delete';
265
-		$this->deleteItemsBase( $ids, $path, false );
265
+		$this->deleteItemsBase($ids, $path, false);
266 266
 	}
267 267
 
268 268
 
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 	 * @param boolean $withsub Return also attributes of sub-managers if true
273 273
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
274 274
 	 */
275
-	public function getSearchAttributes( $withsub = true )
275
+	public function getSearchAttributes($withsub = true)
276 276
 	{
277 277
 		$path = 'mshop/customer/manager/submanagers';
278 278
 		$default = ['address', 'group', 'lists', 'property'];
279 279
 
280
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, $default, $withsub );
280
+		return $this->getSearchAttributesBase($this->searchConfig, $path, $default, $withsub);
281 281
 	}
282 282
 
283 283
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 */
289 289
 	public function createItem()
290 290
 	{
291
-		return $this->createItemBase( ['customer.siteid' => $this->getContext()->getLocale()->getSiteId()] );
291
+		return $this->createItemBase(['customer.siteid' => $this->getContext()->getLocale()->getSiteId()]);
292 292
 	}
293 293
 
294 294
 
@@ -299,32 +299,32 @@  discard block
 block discarded – undo
299 299
 	 * @param boolean $fetch True if the new ID should be returned in the item
300 300
 	 * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID
301 301
 	 */
302
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
302
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
303 303
 	{
304 304
 		$iface = '\\Aimeos\\MShop\\Customer\\Item\\FosUser';
305
-		if( !( $item instanceof $iface ) ) {
306
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
305
+		if (!($item instanceof $iface)) {
306
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface));
307 307
 		}
308 308
 
309
-		if( !$item->isModified() )
309
+		if (!$item->isModified())
310 310
 		{
311
-			$item = $this->savePropertyItems( $item, 'customer' );
312
-			$item = $this->saveAddressItems( $item, 'customer' );
313
-			return $this->saveRefItems( $item, 'customer' );
311
+			$item = $this->savePropertyItems($item, 'customer');
312
+			$item = $this->saveAddressItems($item, 'customer');
313
+			return $this->saveRefItems($item, 'customer');
314 314
 		}
315 315
 
316 316
 		$context = $this->getContext();
317 317
 		$dbm = $context->getDatabaseManager();
318 318
 		$dbname = $this->getResourceName();
319
-		$conn = $dbm->acquire( $dbname );
319
+		$conn = $dbm->acquire($dbname);
320 320
 
321 321
 		try
322 322
 		{
323 323
 			$id = $item->getId();
324
-			$date = date( 'Y-m-d H:i:s' );
324
+			$date = date('Y-m-d H:i:s');
325 325
 			$billingAddress = $item->getPaymentAddress();
326 326
 
327
-			if( $id === null )
327
+			if ($id === null)
328 328
 			{
329 329
 				/** mshop/customer/manager/fosuser/insert
330 330
 				 * Inserts a new customer record into the database table
@@ -388,51 +388,51 @@  discard block
 block discarded – undo
388 388
 				$path = 'mshop/customer/manager/fosuser/update';
389 389
 			}
390 390
 
391
-			$stmt = $this->getCachedStatement( $conn, $path );
392
-
393
-			$stmt->bind( 1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT );
394
-			$stmt->bind( 2, $item->getCode() ); // canonical username
395
-			$stmt->bind( 3, $item->getCode() ); // username
396
-			$stmt->bind( 4, $billingAddress->getCompany() );
397
-			$stmt->bind( 5, $billingAddress->getVatID() );
398
-			$stmt->bind( 6, $billingAddress->getSalutation() );
399
-			$stmt->bind( 7, $billingAddress->getTitle() );
400
-			$stmt->bind( 8, $billingAddress->getFirstname() );
401
-			$stmt->bind( 9, $billingAddress->getLastname() );
402
-			$stmt->bind( 10, $billingAddress->getAddress1() );
403
-			$stmt->bind( 11, $billingAddress->getAddress2() );
404
-			$stmt->bind( 12, $billingAddress->getAddress3() );
405
-			$stmt->bind( 13, $billingAddress->getPostal() );
406
-			$stmt->bind( 14, $billingAddress->getCity() );
407
-			$stmt->bind( 15, $billingAddress->getState() );
408
-			$stmt->bind( 16, $billingAddress->getCountryId() );
409
-			$stmt->bind( 17, $billingAddress->getLanguageId() );
410
-			$stmt->bind( 18, $billingAddress->getTelephone() );
411
-			$stmt->bind( 19, $billingAddress->getEmail() );
412
-			$stmt->bind( 20, $billingAddress->getEmail() );
413
-			$stmt->bind( 21, $billingAddress->getTelefax() );
414
-			$stmt->bind( 22, $billingAddress->getWebsite() );
415
-			$stmt->bind( 23, $billingAddress->getLongitude() );
416
-			$stmt->bind( 24, $billingAddress->getLatitude() );
417
-			$stmt->bind( 25, $item->getBirthday() );
418
-			$stmt->bind( 26, ( $item->getStatus() > 0 ? true : false ), \Aimeos\MW\DB\Statement\Base::PARAM_BOOL );
419
-			$stmt->bind( 27, $item->getDateVerified() );
420
-			$stmt->bind( 28, $item->getPassword() );
421
-			$stmt->bind( 29, $date ); // Modification time
422
-			$stmt->bind( 30, $context->getEditor() );
423
-			$stmt->bind( 31, serialize( $item->getRoles() ) );
424
-			$stmt->bind( 32, $item->getSalt() );
425
-
426
-			if( $id !== null ) {
427
-				$stmt->bind( 33, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
428
-				$item->setId( $id );
391
+			$stmt = $this->getCachedStatement($conn, $path);
392
+
393
+			$stmt->bind(1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT);
394
+			$stmt->bind(2, $item->getCode()); // canonical username
395
+			$stmt->bind(3, $item->getCode()); // username
396
+			$stmt->bind(4, $billingAddress->getCompany());
397
+			$stmt->bind(5, $billingAddress->getVatID());
398
+			$stmt->bind(6, $billingAddress->getSalutation());
399
+			$stmt->bind(7, $billingAddress->getTitle());
400
+			$stmt->bind(8, $billingAddress->getFirstname());
401
+			$stmt->bind(9, $billingAddress->getLastname());
402
+			$stmt->bind(10, $billingAddress->getAddress1());
403
+			$stmt->bind(11, $billingAddress->getAddress2());
404
+			$stmt->bind(12, $billingAddress->getAddress3());
405
+			$stmt->bind(13, $billingAddress->getPostal());
406
+			$stmt->bind(14, $billingAddress->getCity());
407
+			$stmt->bind(15, $billingAddress->getState());
408
+			$stmt->bind(16, $billingAddress->getCountryId());
409
+			$stmt->bind(17, $billingAddress->getLanguageId());
410
+			$stmt->bind(18, $billingAddress->getTelephone());
411
+			$stmt->bind(19, $billingAddress->getEmail());
412
+			$stmt->bind(20, $billingAddress->getEmail());
413
+			$stmt->bind(21, $billingAddress->getTelefax());
414
+			$stmt->bind(22, $billingAddress->getWebsite());
415
+			$stmt->bind(23, $billingAddress->getLongitude());
416
+			$stmt->bind(24, $billingAddress->getLatitude());
417
+			$stmt->bind(25, $item->getBirthday());
418
+			$stmt->bind(26, ($item->getStatus() > 0 ? true : false), \Aimeos\MW\DB\Statement\Base::PARAM_BOOL);
419
+			$stmt->bind(27, $item->getDateVerified());
420
+			$stmt->bind(28, $item->getPassword());
421
+			$stmt->bind(29, $date); // Modification time
422
+			$stmt->bind(30, $context->getEditor());
423
+			$stmt->bind(31, serialize($item->getRoles()));
424
+			$stmt->bind(32, $item->getSalt());
425
+
426
+			if ($id !== null) {
427
+				$stmt->bind(33, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
428
+				$item->setId($id);
429 429
 			} else {
430
-				$stmt->bind( 33, $date ); // Creation time
430
+				$stmt->bind(33, $date); // Creation time
431 431
 			}
432 432
 
433 433
 			$stmt->execute()->finish();
434 434
 
435
-			if( $id === null && $fetch === true )
435
+			if ($id === null && $fetch === true)
436 436
 			{
437 437
 				/** mshop/customer/manager/fosuser/newid
438 438
 				 * Retrieves the ID generated by the database when inserting a new record
@@ -465,22 +465,22 @@  discard block
 block discarded – undo
465 465
 				 * @see mshop/customer/manager/fosuser/count
466 466
 				 */
467 467
 				$path = 'mshop/customer/manager/fosuser/newid';
468
-				$item->setId( $this->newId( $conn, $path ) );
468
+				$item->setId($this->newId($conn, $path));
469 469
 			}
470 470
 
471
-			$dbm->release( $conn, $dbname );
471
+			$dbm->release($conn, $dbname);
472 472
 		}
473
-		catch( \Exception $e )
473
+		catch (\Exception $e)
474 474
 		{
475
-			$dbm->release( $conn, $dbname );
475
+			$dbm->release($conn, $dbname);
476 476
 			throw $e;
477 477
 		}
478 478
 
479
-		$this->addGroups( $item );
479
+		$this->addGroups($item);
480 480
 
481
-		$item = $this->savePropertyItems( $item, 'customer' );
482
-		$item = $this->saveAddressItems( $item, 'customer' );
483
-		return $this->saveRefItems( $item, 'customer' );
481
+		$item = $this->savePropertyItems($item, 'customer');
482
+		$item = $this->saveAddressItems($item, 'customer');
483
+		return $this->saveRefItems($item, 'customer');
484 484
 	}
485 485
 
486 486
 
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
 	 * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface
493 493
 	 * @throws \Aimeos\MShop\Customer\Exception If creating items failed
494 494
 	 */
495
-	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null )
495
+	public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null)
496 496
 	{
497 497
 		$dbm = $this->getContext()->getDatabaseManager();
498 498
 		$dbname = $this->getResourceName();
499
-		$conn = $dbm->acquire( $dbname );
499
+		$conn = $dbm->acquire($dbname);
500 500
 		$map = [];
501 501
 
502 502
 		try
@@ -504,32 +504,32 @@  discard block
 block discarded – undo
504 504
 			$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
505 505
 			$cfgPathSearch = 'mshop/customer/manager/fosuser/search';
506 506
 			$cfgPathCount = 'mshop/customer/manager/fosuser/count';
507
-			$required = array( 'customer' );
507
+			$required = array('customer');
508 508
 
509
-			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
510
-			while( ( $row = $results->fetch() ) !== false ) {
511
-				$map[ $row['customer.id'] ] = $row;
509
+			$results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level);
510
+			while (($row = $results->fetch()) !== false) {
511
+				$map[$row['customer.id']] = $row;
512 512
 			}
513 513
 
514
-			$dbm->release( $conn, $dbname );
514
+			$dbm->release($conn, $dbname);
515 515
 		}
516
-		catch( \Exception $e )
516
+		catch (\Exception $e)
517 517
 		{
518
-			$dbm->release( $conn, $dbname  );
518
+			$dbm->release($conn, $dbname);
519 519
 			throw $e;
520 520
 		}
521 521
 
522 522
 		$addrItems = [];
523
-		if( in_array( 'customer/address', $ref, true ) ) {
524
-			$addrItems = $this->getAddressItems( array_keys( $map ), 'customer' );
523
+		if (in_array('customer/address', $ref, true)) {
524
+			$addrItems = $this->getAddressItems(array_keys($map), 'customer');
525 525
 		}
526 526
 
527 527
 		$propItems = [];
528
-		if( in_array( 'customer/property', $ref, true ) ) {
529
-			$propItems = $this->getPropertyItems( array_keys( $map ), 'customer' );
528
+		if (in_array('customer/property', $ref, true)) {
529
+			$propItems = $this->getPropertyItems(array_keys($map), 'customer');
530 530
 		}
531 531
 
532
-		return $this->buildItems( $map, $ref, 'customer', $addrItems, $propItems );
532
+		return $this->buildItems($map, $ref, 'customer', $addrItems, $propItems);
533 533
 	}
534 534
 
535 535
 
@@ -540,9 +540,9 @@  discard block
 block discarded – undo
540 540
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
541 541
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
542 542
 	 */
543
-	public function getSubManager( $manager, $name = null )
543
+	public function getSubManager($manager, $name = null)
544 544
 	{
545
-		return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'FosUser' : $name ) );
545
+		return $this->getSubManagerBase('customer', $manager, ($name === null ? 'FosUser' : $name));
546 546
 	}
547 547
 
548 548
 
@@ -556,15 +556,15 @@  discard block
 block discarded – undo
556 556
 	 * @param array $propItems List of property items of the customer item
557 557
 	 * @return \Aimeos\MShop\Customer\Item\Iface New customer item
558 558
 	 */
559
-	protected function createItemBase( array $values = [], array $listItems = [], array $refItems = [],
560
-		array $addresses = [], array $propItems = [] )
559
+	protected function createItemBase(array $values = [], array $listItems = [], array $refItems = [],
560
+		array $addresses = [], array $propItems = [])
561 561
 	{
562
-		if( !isset( $this->addressManager ) ) {
563
-			$this->addressManager = $this->getObject()->getSubManager( 'address' );
562
+		if (!isset($this->addressManager)) {
563
+			$this->addressManager = $this->getObject()->getSubManager('address');
564 564
 		}
565 565
 
566
-		if( isset( $values['roles'] ) ) {
567
-			$values['roles'] = unserialize( $values['roles'] );
566
+		if (isset($values['roles'])) {
567
+			$values['roles'] = unserialize($values['roles']);
568 568
 		}
569 569
 
570 570
 		$helper = $this->getPasswordHelper();
Please login to merge, or discard this patch.
lib/custom/setup/default/schema/customer.php 1 patch
Spacing   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -8,221 +8,221 @@
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'fos_user' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
-
13
-			$table = $schema->createTable( 'fos_user' );
14
-
15
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
16
-			$table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) );
17
-			$table->addColumn( 'username', 'string', array( 'length' => 180 ) );
18
-			$table->addColumn( 'username_canonical', 'string', array( 'length' => 180 ) );
19
-			$table->addColumn( 'email', 'string', array( 'length' => 180 ) );
20
-			$table->addColumn( 'email_canonical', 'string', array( 'length' => 180 ) );
21
-			$table->addColumn( 'enabled', 'boolean', [] );
22
-			$table->addColumn( 'salt', 'string', array( 'length' => 255, 'notnull' => false ) );
23
-			$table->addColumn( 'password', 'string', array( 'length' => 255 ) );
24
-			$table->addColumn( 'last_login', 'datetime', array( 'notnull' => false ) );
25
-			$table->addColumn( 'confirmation_token', 'string', array( 'length' => 180, 'notnull' => false ) );
26
-			$table->addColumn( 'password_requested_at', 'datetime', array( 'notnull' => false ) );
27
-			$table->addColumn( 'roles', 'text', array( 'length' => 0x7fffffff, 'comment' => '(DC2Type:array)' ) );
28
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
29
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
30
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
31
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
32
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
33
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
34
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
35
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
36
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
37
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
38
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
39
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
40
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
41
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
42
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
43
-			$table->addColumn( 'telefax', 'string', array( 'length' => 32 ) );
44
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
45
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
46
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
47
-			$table->addColumn( 'birthday', 'date', array( 'notnull' => false ) );
48
-			$table->addColumn( 'vdate', 'date', array( 'notnull' => false ) );
49
-			$table->addColumn( 'mtime', 'datetime', array( 'notnull' => false ) );
50
-			$table->addColumn( 'ctime', 'datetime', array( 'notnull' => false ) );
51
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
52
-
53
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosus_id' );
54
-			$table->addUniqueIndex( array( 'confirmation_token' ), 'unq_fosus_confirmtoken' );
55
-			$table->addUniqueIndex( array( 'username_canonical' ), 'unq_fosus_username' );
56
-			$table->addUniqueIndex( array( 'email_canonical' ), 'unq_fosus_email' );
57
-			$table->addIndex( array( 'langid' ), 'idx_fosus_langid' );
58
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosus_last_first' );
59
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_fosus_post_addr1' );
60
-			$table->addIndex( array( 'postal', 'city' ), 'idx_fosus_post_city' );
61
-			$table->addIndex( array( 'lastname' ), 'idx_fosus_lastname' );
62
-			$table->addIndex( array( 'address1' ), 'idx_fosus_address1' );
63
-			$table->addIndex( array( 'city' ), 'idx_fosus_city' );
11
+		'fos_user' => function(\Doctrine\DBAL\Schema\Schema $schema) {
12
+
13
+			$table = $schema->createTable('fos_user');
14
+
15
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
16
+			$table->addColumn('siteid', 'integer', array('notnull' => false));
17
+			$table->addColumn('username', 'string', array('length' => 180));
18
+			$table->addColumn('username_canonical', 'string', array('length' => 180));
19
+			$table->addColumn('email', 'string', array('length' => 180));
20
+			$table->addColumn('email_canonical', 'string', array('length' => 180));
21
+			$table->addColumn('enabled', 'boolean', []);
22
+			$table->addColumn('salt', 'string', array('length' => 255, 'notnull' => false));
23
+			$table->addColumn('password', 'string', array('length' => 255));
24
+			$table->addColumn('last_login', 'datetime', array('notnull' => false));
25
+			$table->addColumn('confirmation_token', 'string', array('length' => 180, 'notnull' => false));
26
+			$table->addColumn('password_requested_at', 'datetime', array('notnull' => false));
27
+			$table->addColumn('roles', 'text', array('length' => 0x7fffffff, 'comment' => '(DC2Type:array)'));
28
+			$table->addColumn('salutation', 'string', array('length' => 8));
29
+			$table->addColumn('company', 'string', array('length' => 100));
30
+			$table->addColumn('vatid', 'string', array('length' => 32));
31
+			$table->addColumn('title', 'string', array('length' => 64));
32
+			$table->addColumn('firstname', 'string', array('length' => 64));
33
+			$table->addColumn('lastname', 'string', array('length' => 64));
34
+			$table->addColumn('address1', 'string', array('length' => 200));
35
+			$table->addColumn('address2', 'string', array('length' => 200));
36
+			$table->addColumn('address3', 'string', array('length' => 200));
37
+			$table->addColumn('postal', 'string', array('length' => 16));
38
+			$table->addColumn('city', 'string', array('length' => 200));
39
+			$table->addColumn('state', 'string', array('length' => 200));
40
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
41
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
42
+			$table->addColumn('telephone', 'string', array('length' => 32));
43
+			$table->addColumn('telefax', 'string', array('length' => 32));
44
+			$table->addColumn('website', 'string', array('length' => 255));
45
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
46
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
47
+			$table->addColumn('birthday', 'date', array('notnull' => false));
48
+			$table->addColumn('vdate', 'date', array('notnull' => false));
49
+			$table->addColumn('mtime', 'datetime', array('notnull' => false));
50
+			$table->addColumn('ctime', 'datetime', array('notnull' => false));
51
+			$table->addColumn('editor', 'string', array('length' => 255));
52
+
53
+			$table->setPrimaryKey(array('id'), 'pk_fosus_id');
54
+			$table->addUniqueIndex(array('confirmation_token'), 'unq_fosus_confirmtoken');
55
+			$table->addUniqueIndex(array('username_canonical'), 'unq_fosus_username');
56
+			$table->addUniqueIndex(array('email_canonical'), 'unq_fosus_email');
57
+			$table->addIndex(array('langid'), 'idx_fosus_langid');
58
+			$table->addIndex(array('lastname', 'firstname'), 'idx_fosus_last_first');
59
+			$table->addIndex(array('postal', 'address1'), 'idx_fosus_post_addr1');
60
+			$table->addIndex(array('postal', 'city'), 'idx_fosus_post_city');
61
+			$table->addIndex(array('lastname'), 'idx_fosus_lastname');
62
+			$table->addIndex(array('address1'), 'idx_fosus_address1');
63
+			$table->addIndex(array('city'), 'idx_fosus_city');
64 64
 
65 65
 			return $schema;
66 66
 		},
67 67
 
68
-		'fos_user_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
69
-
70
-			$table = $schema->createTable( 'fos_user_address' );
71
-
72
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
73
-			$table->addColumn( 'siteid', 'integer', [] );
74
-			$table->addColumn( 'parentid', 'integer', [] );
75
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
76
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
77
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
78
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
79
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
80
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
81
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
82
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
83
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
84
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
85
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
86
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
87
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
88
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
89
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
90
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
91
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
92
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
93
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
94
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
95
-			$table->addColumn( 'flag', 'integer', [] );
96
-			$table->addColumn( 'pos', 'smallint', [] );
97
-			$table->addColumn( 'mtime', 'datetime', [] );
98
-			$table->addColumn( 'ctime', 'datetime', [] );
99
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
100
-
101
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosad_id' );
102
-			$table->addIndex( array( 'parentid' ), 'idx_fosad_pid' );
103
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosad_last_first' );
104
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_fosad_post_addr1' );
105
-			$table->addIndex( array( 'postal', 'city' ), 'idx_fosad_post_city' );
106
-			$table->addIndex( array( 'address1' ), 'idx_fosad_address1' );
107
-			$table->addIndex( array( 'city' ), 'idx_fosad_city' );
108
-			$table->addIndex( array( 'email' ), 'idx_fosad_email' );
109
-
110
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
111
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosad_pid' );
68
+		'fos_user_address' => function(\Doctrine\DBAL\Schema\Schema $schema) {
69
+
70
+			$table = $schema->createTable('fos_user_address');
71
+
72
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
73
+			$table->addColumn('siteid', 'integer', []);
74
+			$table->addColumn('parentid', 'integer', []);
75
+			$table->addColumn('company', 'string', array('length' => 100));
76
+			$table->addColumn('vatid', 'string', array('length' => 32));
77
+			$table->addColumn('salutation', 'string', array('length' => 8));
78
+			$table->addColumn('title', 'string', array('length' => 64));
79
+			$table->addColumn('firstname', 'string', array('length' => 64));
80
+			$table->addColumn('lastname', 'string', array('length' => 64));
81
+			$table->addColumn('address1', 'string', array('length' => 200));
82
+			$table->addColumn('address2', 'string', array('length' => 200));
83
+			$table->addColumn('address3', 'string', array('length' => 200));
84
+			$table->addColumn('postal', 'string', array('length' => 16));
85
+			$table->addColumn('city', 'string', array('length' => 200));
86
+			$table->addColumn('state', 'string', array('length' => 200));
87
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
88
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
89
+			$table->addColumn('telephone', 'string', array('length' => 32));
90
+			$table->addColumn('email', 'string', array('length' => 255));
91
+			$table->addColumn('telefax', 'string', array('length' => 255));
92
+			$table->addColumn('website', 'string', array('length' => 255));
93
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
94
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
95
+			$table->addColumn('flag', 'integer', []);
96
+			$table->addColumn('pos', 'smallint', []);
97
+			$table->addColumn('mtime', 'datetime', []);
98
+			$table->addColumn('ctime', 'datetime', []);
99
+			$table->addColumn('editor', 'string', array('length' => 255));
100
+
101
+			$table->setPrimaryKey(array('id'), 'pk_fosad_id');
102
+			$table->addIndex(array('parentid'), 'idx_fosad_pid');
103
+			$table->addIndex(array('lastname', 'firstname'), 'idx_fosad_last_first');
104
+			$table->addIndex(array('postal', 'address1'), 'idx_fosad_post_addr1');
105
+			$table->addIndex(array('postal', 'city'), 'idx_fosad_post_city');
106
+			$table->addIndex(array('address1'), 'idx_fosad_address1');
107
+			$table->addIndex(array('city'), 'idx_fosad_city');
108
+			$table->addIndex(array('email'), 'idx_fosad_email');
109
+
110
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
111
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosad_pid');
112 112
 
113 113
 			return $schema;
114 114
 		},
115 115
 
116
-		'fos_user_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
116
+		'fos_user_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
117 117
 
118
-			$table = $schema->createTable( 'fos_user_list_type' );
118
+			$table = $schema->createTable('fos_user_list_type');
119 119
 
120
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
121
-			$table->addColumn( 'siteid', 'integer', [] );
122
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
123
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
124
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
125
-			$table->addColumn( 'pos', 'integer', [] );
126
-			$table->addColumn( 'status', 'smallint', [] );
127
-			$table->addColumn( 'mtime', 'datetime', [] );
128
-			$table->addColumn( 'ctime', 'datetime', [] );
129
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
120
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
121
+			$table->addColumn('siteid', 'integer', []);
122
+			$table->addColumn('domain', 'string', array('length' => 32));
123
+			$table->addColumn('code', 'string', array('length' => 32));
124
+			$table->addColumn('label', 'string', array('length' => 255));
125
+			$table->addColumn('pos', 'integer', []);
126
+			$table->addColumn('status', 'smallint', []);
127
+			$table->addColumn('mtime', 'datetime', []);
128
+			$table->addColumn('ctime', 'datetime', []);
129
+			$table->addColumn('editor', 'string', array('length' => 255));
130 130
 
131
-			$table->setPrimaryKey( array( 'id' ), 'pk_foslity_id' );
132
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_foslity_sid_dom_code' );
133
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_foslity_sid_status_pos' );
134
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_foslity_sid_label' );
135
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_foslity_sid_code' );
131
+			$table->setPrimaryKey(array('id'), 'pk_foslity_id');
132
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_foslity_sid_dom_code');
133
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_foslity_sid_status_pos');
134
+			$table->addIndex(array('siteid', 'label'), 'idx_foslity_sid_label');
135
+			$table->addIndex(array('siteid', 'code'), 'idx_foslity_sid_code');
136 136
 
137 137
 			return $schema;
138 138
 		},
139 139
 
140
-		'fos_user_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
141
-
142
-			$table = $schema->createTable( 'fos_user_list' );
143
-
144
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
145
-			$table->addColumn( 'parentid', 'integer', [] );
146
-			$table->addColumn( 'siteid', 'integer', [] );
147
-			$table->addColumn( 'typeid', 'integer', [] );
148
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
149
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
150
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
151
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
152
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
153
-			$table->addColumn( 'pos', 'integer', [] );
154
-			$table->addColumn( 'status', 'smallint', [] );
155
-			$table->addColumn( 'mtime', 'datetime', [] );
156
-			$table->addColumn( 'ctime', 'datetime', [] );
157
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
158
-
159
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosli_id' );
160
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_fosli_sid_dm_rid_tid_pid' );
161
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_fosli_sid_stat_start_end' );
162
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_fosli_pid_sid_rid_dom_tid' );
163
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_fosli_pid_sid_start' );
164
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_fosli_pid_sid_end' );
165
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_fosli_pid_sid_pos' );
166
-
167
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
168
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_pid' );
169
-
170
-			$table->addForeignKeyConstraint( 'fos_user_list_type', array( 'typeid' ), array( 'id' ),
171
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_typeid' );
140
+		'fos_user_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
141
+
142
+			$table = $schema->createTable('fos_user_list');
143
+
144
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
145
+			$table->addColumn('parentid', 'integer', []);
146
+			$table->addColumn('siteid', 'integer', []);
147
+			$table->addColumn('typeid', 'integer', []);
148
+			$table->addColumn('domain', 'string', array('length' => 32));
149
+			$table->addColumn('refid', 'string', array('length' => 32));
150
+			$table->addColumn('start', 'datetime', array('notnull' => false));
151
+			$table->addColumn('end', 'datetime', array('notnull' => false));
152
+			$table->addColumn('config', 'text', array('length' => 0xffff));
153
+			$table->addColumn('pos', 'integer', []);
154
+			$table->addColumn('status', 'smallint', []);
155
+			$table->addColumn('mtime', 'datetime', []);
156
+			$table->addColumn('ctime', 'datetime', []);
157
+			$table->addColumn('editor', 'string', array('length' => 255));
158
+
159
+			$table->setPrimaryKey(array('id'), 'pk_fosli_id');
160
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_fosli_sid_dm_rid_tid_pid');
161
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_fosli_sid_stat_start_end');
162
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_fosli_pid_sid_rid_dom_tid');
163
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_fosli_pid_sid_start');
164
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_fosli_pid_sid_end');
165
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_fosli_pid_sid_pos');
166
+
167
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
168
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_pid');
169
+
170
+			$table->addForeignKeyConstraint('fos_user_list_type', array('typeid'), array('id'),
171
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_typeid');
172 172
 
173 173
 			return $schema;
174 174
 		},
175 175
 
176
-		'fos_user_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
176
+		'fos_user_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
177 177
 
178
-			$table = $schema->createTable( 'fos_user_property_type' );
178
+			$table = $schema->createTable('fos_user_property_type');
179 179
 
180
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
181
-			$table->addColumn( 'siteid', 'integer', [] );
182
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
183
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
184
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
185
-			$table->addColumn( 'pos', 'integer', [] );
186
-			$table->addColumn( 'status', 'smallint', [] );
187
-			$table->addColumn( 'mtime', 'datetime', [] );
188
-			$table->addColumn( 'ctime', 'datetime', [] );
189
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
180
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
181
+			$table->addColumn('siteid', 'integer', []);
182
+			$table->addColumn('domain', 'string', array('length' => 32));
183
+			$table->addColumn('code', 'string', array('length' => 32));
184
+			$table->addColumn('label', 'string', array('length' => 255));
185
+			$table->addColumn('pos', 'integer', []);
186
+			$table->addColumn('status', 'smallint', []);
187
+			$table->addColumn('mtime', 'datetime', []);
188
+			$table->addColumn('ctime', 'datetime', []);
189
+			$table->addColumn('editor', 'string', array('length' => 255));
190 190
 
191
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosprty_id' );
192
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_fosprty_sid_dom_code' );
193
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_fosprty_sid_status_pos' );
194
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_fosprty_sid_label' );
195
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_fosprty_sid_code' );
191
+			$table->setPrimaryKey(array('id'), 'pk_fosprty_id');
192
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_fosprty_sid_dom_code');
193
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_fosprty_sid_status_pos');
194
+			$table->addIndex(array('siteid', 'label'), 'idx_fosprty_sid_label');
195
+			$table->addIndex(array('siteid', 'code'), 'idx_fosprty_sid_code');
196 196
 
197 197
 			return $schema;
198 198
 		},
199 199
 
200
-		'fos_user_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
200
+		'fos_user_property' => function(\Doctrine\DBAL\Schema\Schema $schema) {
201 201
 
202
-			$table = $schema->createTable( 'fos_user_property' );
202
+			$table = $schema->createTable('fos_user_property');
203 203
 
204
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
205
-			$table->addColumn( 'siteid', 'integer', [] );
206
-			$table->addColumn( 'parentid', 'integer', [] );
207
-			$table->addColumn( 'typeid', 'integer', [] );
208
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
209
-			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
210
-			$table->addColumn( 'mtime', 'datetime', [] );
211
-			$table->addColumn( 'ctime', 'datetime', [] );
212
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
204
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
205
+			$table->addColumn('siteid', 'integer', []);
206
+			$table->addColumn('parentid', 'integer', []);
207
+			$table->addColumn('typeid', 'integer', []);
208
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
209
+			$table->addColumn('value', 'string', array('length' => 255));
210
+			$table->addColumn('mtime', 'datetime', []);
211
+			$table->addColumn('ctime', 'datetime', []);
212
+			$table->addColumn('editor', 'string', array('length' => 255));
213 213
 
214
-			$table->setPrimaryKey( array( 'id' ), 'pk_fospr_id' );
215
-			$table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_fospr_sid_tid_lid_value' );
216
-			$table->addIndex( array( 'siteid', 'langid' ), 'idx_fospr_sid_langid' );
217
-			$table->addIndex( array( 'siteid', 'value' ), 'idx_fospr_sid_value' );
218
-			$table->addIndex( array( 'typeid' ), 'fk_fospr_typeid' );
219
-			$table->addIndex( array( 'parentid' ), 'fk_fospr_pid' );
214
+			$table->setPrimaryKey(array('id'), 'pk_fospr_id');
215
+			$table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_fospr_sid_tid_lid_value');
216
+			$table->addIndex(array('siteid', 'langid'), 'idx_fospr_sid_langid');
217
+			$table->addIndex(array('siteid', 'value'), 'idx_fospr_sid_value');
218
+			$table->addIndex(array('typeid'), 'fk_fospr_typeid');
219
+			$table->addIndex(array('parentid'), 'fk_fospr_pid');
220 220
 
221
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
222
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_pid' );
221
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
222
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_pid');
223 223
 
224
-			$table->addForeignKeyConstraint( 'fos_user_property_type', array( 'typeid' ), array( 'id' ),
225
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_typeid' );
224
+			$table->addForeignKeyConstraint('fos_user_property_type', array('typeid'), array('id'),
225
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_typeid');
226 226
 
227 227
 			return $schema;
228 228
 		},
Please login to merge, or discard this patch.