Completed
Push — master ( fd5919...1ad5eb )
by Aimeos
01:55
created
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.
lib/custom/setup/CustomerRemoveLostUserDataFosuser.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public function getPostDependencies()
40 40
 	{
41
-		return array( 'TablesCreateMShop' );
41
+		return array('TablesCreateMShop');
42 42
 	}
43 43
 
44 44
 
@@ -47,29 +47,29 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function migrate()
49 49
 	{
50
-		$this->msg( 'Remove left over FOS user address records', 0 );
50
+		$this->msg('Remove left over FOS user address records', 0);
51 51
 
52
-		if( $this->schema->tableExists( 'fos_user' ) && $this->schema->tableExists( 'fos_user_address' ) )
52
+		if ($this->schema->tableExists('fos_user') && $this->schema->tableExists('fos_user_address'))
53 53
 		{
54
-			$this->execute( $this->sql['address'] );
55
-			$this->status( 'done' );
54
+			$this->execute($this->sql['address']);
55
+			$this->status('done');
56 56
 		}
57 57
 		else
58 58
 		{
59
-			$this->status( 'OK' );
59
+			$this->status('OK');
60 60
 		}
61 61
 
62 62
 
63
-		$this->msg( 'Remove left over FOS user list records', 0 );
63
+		$this->msg('Remove left over FOS user list records', 0);
64 64
 
65
-		if( $this->schema->tableExists( 'fos_user' ) && $this->schema->tableExists( 'fos_user_list' ) )
65
+		if ($this->schema->tableExists('fos_user') && $this->schema->tableExists('fos_user_list'))
66 66
 		{
67
-			$this->execute( $this->sql['list'] );
68
-			$this->status( 'done' );
67
+			$this->execute($this->sql['list']);
68
+			$this->status('done');
69 69
 		}
70 70
 		else
71 71
 		{
72
-			$this->status( 'OK' );
72
+			$this->status('OK');
73 73
 		}
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Property/Type/FosUser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		'customer.property.type.id' => array(
25 25
 			'code' => 'customer.property.type.id',
26 26
 			'internalcode' => 'fosprty."id"',
27
-			'internaldeps' => array( 'LEFT JOIN "fos_user_property_type" AS fosprty ON ( fospr."typeid" = fosprty."id" )' ),
27
+			'internaldeps' => array('LEFT JOIN "fos_user_property_type" AS fosprty ON ( fospr."typeid" = fosprty."id" )'),
28 28
 			'label' => 'Property type ID',
29 29
 			'type' => 'integer',
30 30
 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
107 107
 	 */
108
-	public function cleanup( array $siteids )
108
+	public function cleanup(array $siteids)
109 109
 	{
110 110
 		$path = 'mshop/customer/manager/property/type/submanagers';
111
-		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
112
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
111
+		foreach ($this->getContext()->getConfig()->get($path, []) as $domain) {
112
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
113 113
 		}
114 114
 
115
-		$this->cleanupBase( $siteids, 'mshop/customer/manager/property/type/fosuser/delete' );
115
+		$this->cleanupBase($siteids, 'mshop/customer/manager/property/type/fosuser/delete');
116 116
 	}
117 117
 
118 118
 
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	 * @param boolean $withsub Return also attributes of sub-managers if true
123 123
 	 * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface
124 124
 	 */
125
-	public function getSearchAttributes( $withsub = true )
125
+	public function getSearchAttributes($withsub = true)
126 126
 	{
127 127
 		$path = 'mshop/customer/manager/property/type/submanagers';
128 128
 
129
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub );
129
+		return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub);
130 130
 	}
131 131
 
132 132
 
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
138 138
 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g types, lists etc.
139 139
 	 */
140
-	public function getSubManager( $manager, $name = null )
140
+	public function getSubManager($manager, $name = null)
141 141
 	{
142
-		return $this->getSubManagerBase( 'customer', 'property/type/' . $manager, ( $name === null ? 'FosUser' : $name ) );
142
+		return $this->getSubManagerBase('customer', 'property/type/' . $manager, ($name === null ? 'FosUser' : $name));
143 143
 	}
144 144
 
145 145
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Property/FosUser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		'customer.property.id' => array(
25 25
 			'code' => 'customer.property.id',
26 26
 			'internalcode' => 'fospr."id"',
27
-			'internaldeps'=>array( 'LEFT JOIN "fos_user_property" AS fospr ON ( fospr."parentid" = fos."id" )' ),
27
+			'internaldeps'=>array('LEFT JOIN "fos_user_property" AS fospr ON ( fospr."parentid" = fos."id" )'),
28 28
 			'label' => 'Property ID',
29 29
 			'type' => 'integer',
30 30
 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @param integer[] $siteids List of IDs for sites whose entries should be deleted
102 102
 	 */
103
-	public function cleanup( array $siteids )
103
+	public function cleanup(array $siteids)
104 104
 	{
105 105
 		$path = 'mshop/customer/manager/property/submanagers';
106
-		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
107
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
106
+		foreach ($this->getContext()->getConfig()->get($path, []) as $domain) {
107
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
108 108
 		}
109 109
 
110
-		$this->cleanupBase( $siteids, 'mshop/customer/manager/property/fosuser/delete' );
110
+		$this->cleanupBase($siteids, 'mshop/customer/manager/property/fosuser/delete');
111 111
 	}
112 112
 
113 113
 
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	 * @param boolean $withsub Return also attributes of sub-managers if true
118 118
 	 * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface
119 119
 	 */
120
-	public function getSearchAttributes( $withsub = true )
120
+	public function getSearchAttributes($withsub = true)
121 121
 	{
122 122
 		$path = 'mshop/customer/manager/property/submanagers';
123 123
 
124
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, ['type'], $withsub );
124
+		return $this->getSearchAttributesBase($this->searchConfig, $path, ['type'], $withsub);
125 125
 	}
126 126
 
127 127
 
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 	 * configuration (or Default) if null
134 134
 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g property types, property lists etc.
135 135
 	 */
136
-	public function getSubManager( $manager, $name = null )
136
+	public function getSubManager($manager, $name = null)
137 137
 	{
138
-		return $this->getSubManagerBase( 'customer', 'property/' . $manager, ( $name === null ? 'FosUser' : $name ) );
138
+		return $this->getSubManagerBase('customer', 'property/' . $manager, ($name === null ? 'FosUser' : $name));
139 139
 	}
140 140
 
141 141
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Address/FosUser.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
 			'label' => 'Customer address ID',
26 26
 			'code' => 'customer.address.id',
27 27
 			'internalcode' => 'fosad."id"',
28
-			'internaldeps' => array( 'LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )' ),
28
+			'internaldeps' => array('LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )'),
29 29
 			'type' => 'integer',
30 30
 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
31 31
 			'public' => false,
@@ -222,14 +222,14 @@  discard block
 block discarded – undo
222 222
 	 *
223 223
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
224 224
 	 */
225
-	public function cleanup( array $siteids )
225
+	public function cleanup(array $siteids)
226 226
 	{
227 227
 		$path = 'mshop/customer/manager/address/submanagers';
228
-		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
229
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
228
+		foreach ($this->getContext()->getConfig()->get($path, []) as $domain) {
229
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
230 230
 		}
231 231
 
232
-		$this->cleanupBase( $siteids, 'mshop/customer/manager/lists/fosuser/delete' );
232
+		$this->cleanupBase($siteids, 'mshop/customer/manager/lists/fosuser/delete');
233 233
 	}
234 234
 
235 235
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 	 * @param boolean $withsub Return also attributes of sub-managers if true
240 240
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
241 241
 	 */
242
-	public function getSearchAttributes( $withsub = true )
242
+	public function getSearchAttributes($withsub = true)
243 243
 	{
244 244
 		$path = 'mshop/customer/manager/address/submanagers';
245 245
 
246
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub );
246
+		return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub);
247 247
 	}
248 248
 
249 249
 
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
255 255
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
256 256
 	 */
257
-	public function getSubManager( $manager, $name = null )
257
+	public function getSubManager($manager, $name = null)
258 258
 	{
259
-		return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'FosUser' : $name ) );
259
+		return $this->getSubManagerBase('customer', 'address/' . $manager, ($name === null ? 'FosUser' : $name));
260 260
 	}
261 261
 
262 262
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/FosUser.php 1 patch
Spacing   +87 added lines, -87 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,32 +288,32 @@  discard block
 block discarded – undo
288 288
 	 * @param boolean $fetch True if the new ID should be returned in the item
289 289
 	 * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID
290 290
 	 */
291
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
291
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
292 292
 	{
293 293
 		$iface = '\\Aimeos\\MShop\\Customer\\Item\\FosUser';
294
-		if( !( $item instanceof $iface ) ) {
295
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
294
+		if (!($item instanceof $iface)) {
295
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface));
296 296
 		}
297 297
 
298
-		if( !$item->isModified() )
298
+		if (!$item->isModified())
299 299
 		{
300
-			$item = $this->savePropertyItems( $item, 'customer' );
301
-			$item = $this->saveAddressItems( $item, 'customer' );
302
-			return $this->saveListItems( $item, 'customer' );
300
+			$item = $this->savePropertyItems($item, 'customer');
301
+			$item = $this->saveAddressItems($item, 'customer');
302
+			return $this->saveListItems($item, 'customer');
303 303
 		}
304 304
 
305 305
 		$context = $this->getContext();
306 306
 		$dbm = $context->getDatabaseManager();
307 307
 		$dbname = $this->getResourceName();
308
-		$conn = $dbm->acquire( $dbname );
308
+		$conn = $dbm->acquire($dbname);
309 309
 
310 310
 		try
311 311
 		{
312 312
 			$id = $item->getId();
313
-			$date = date( 'Y-m-d H:i:s' );
313
+			$date = date('Y-m-d H:i:s');
314 314
 			$billingAddress = $item->getPaymentAddress();
315 315
 
316
-			if( $id === null )
316
+			if ($id === null)
317 317
 			{
318 318
 				/** mshop/customer/manager/fosuser/insert
319 319
 				 * Inserts a new customer record into the database table
@@ -377,51 +377,51 @@  discard block
 block discarded – undo
377 377
 				$path = 'mshop/customer/manager/fosuser/update';
378 378
 			}
379 379
 
380
-			$stmt = $this->getCachedStatement( $conn, $path );
381
-
382
-			$stmt->bind( 1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT );
383
-			$stmt->bind( 2, $item->getCode() ); // canonical username
384
-			$stmt->bind( 3, $item->getCode() ); // username
385
-			$stmt->bind( 4, $billingAddress->getCompany() );
386
-			$stmt->bind( 5, $billingAddress->getVatID() );
387
-			$stmt->bind( 6, $billingAddress->getSalutation() );
388
-			$stmt->bind( 7, $billingAddress->getTitle() );
389
-			$stmt->bind( 8, $billingAddress->getFirstname() );
390
-			$stmt->bind( 9, $billingAddress->getLastname() );
391
-			$stmt->bind( 10, $billingAddress->getAddress1() );
392
-			$stmt->bind( 11, $billingAddress->getAddress2() );
393
-			$stmt->bind( 12, $billingAddress->getAddress3() );
394
-			$stmt->bind( 13, $billingAddress->getPostal() );
395
-			$stmt->bind( 14, $billingAddress->getCity() );
396
-			$stmt->bind( 15, $billingAddress->getState() );
397
-			$stmt->bind( 16, $billingAddress->getCountryId() );
398
-			$stmt->bind( 17, $billingAddress->getLanguageId() );
399
-			$stmt->bind( 18, $billingAddress->getTelephone() );
400
-			$stmt->bind( 19, $billingAddress->getEmail() );
401
-			$stmt->bind( 20, $billingAddress->getEmail() );
402
-			$stmt->bind( 21, $billingAddress->getTelefax() );
403
-			$stmt->bind( 22, $billingAddress->getWebsite() );
404
-			$stmt->bind( 23, $billingAddress->getLongitude() );
405
-			$stmt->bind( 24, $billingAddress->getLatitude() );
406
-			$stmt->bind( 25, $item->getBirthday() );
407
-			$stmt->bind( 26, ( $item->getStatus() > 0 ? true : false ), \Aimeos\MW\DB\Statement\Base::PARAM_BOOL );
408
-			$stmt->bind( 27, $item->getDateVerified() );
409
-			$stmt->bind( 28, $item->getPassword() );
410
-			$stmt->bind( 29, $date ); // Modification time
411
-			$stmt->bind( 30, $context->getEditor() );
412
-			$stmt->bind( 31, serialize( $item->getRoles() ) );
413
-			$stmt->bind( 32, $item->getSalt() );
414
-
415
-			if( $id !== null ) {
416
-				$stmt->bind( 33, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
417
-				$item->setId( $id );
380
+			$stmt = $this->getCachedStatement($conn, $path);
381
+
382
+			$stmt->bind(1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT);
383
+			$stmt->bind(2, $item->getCode()); // canonical username
384
+			$stmt->bind(3, $item->getCode()); // username
385
+			$stmt->bind(4, $billingAddress->getCompany());
386
+			$stmt->bind(5, $billingAddress->getVatID());
387
+			$stmt->bind(6, $billingAddress->getSalutation());
388
+			$stmt->bind(7, $billingAddress->getTitle());
389
+			$stmt->bind(8, $billingAddress->getFirstname());
390
+			$stmt->bind(9, $billingAddress->getLastname());
391
+			$stmt->bind(10, $billingAddress->getAddress1());
392
+			$stmt->bind(11, $billingAddress->getAddress2());
393
+			$stmt->bind(12, $billingAddress->getAddress3());
394
+			$stmt->bind(13, $billingAddress->getPostal());
395
+			$stmt->bind(14, $billingAddress->getCity());
396
+			$stmt->bind(15, $billingAddress->getState());
397
+			$stmt->bind(16, $billingAddress->getCountryId());
398
+			$stmt->bind(17, $billingAddress->getLanguageId());
399
+			$stmt->bind(18, $billingAddress->getTelephone());
400
+			$stmt->bind(19, $billingAddress->getEmail());
401
+			$stmt->bind(20, $billingAddress->getEmail());
402
+			$stmt->bind(21, $billingAddress->getTelefax());
403
+			$stmt->bind(22, $billingAddress->getWebsite());
404
+			$stmt->bind(23, $billingAddress->getLongitude());
405
+			$stmt->bind(24, $billingAddress->getLatitude());
406
+			$stmt->bind(25, $item->getBirthday());
407
+			$stmt->bind(26, ($item->getStatus() > 0 ? true : false), \Aimeos\MW\DB\Statement\Base::PARAM_BOOL);
408
+			$stmt->bind(27, $item->getDateVerified());
409
+			$stmt->bind(28, $item->getPassword());
410
+			$stmt->bind(29, $date); // Modification time
411
+			$stmt->bind(30, $context->getEditor());
412
+			$stmt->bind(31, serialize($item->getRoles()));
413
+			$stmt->bind(32, $item->getSalt());
414
+
415
+			if ($id !== null) {
416
+				$stmt->bind(33, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
417
+				$item->setId($id);
418 418
 			} else {
419
-				$stmt->bind( 33, $date ); // Creation time
419
+				$stmt->bind(33, $date); // Creation time
420 420
 			}
421 421
 
422 422
 			$stmt->execute()->finish();
423 423
 
424
-			if( $id === null && $fetch === true )
424
+			if ($id === null && $fetch === true)
425 425
 			{
426 426
 				/** mshop/customer/manager/fosuser/newid
427 427
 				 * Retrieves the ID generated by the database when inserting a new record
@@ -454,22 +454,22 @@  discard block
 block discarded – undo
454 454
 				 * @see mshop/customer/manager/fosuser/count
455 455
 				 */
456 456
 				$path = 'mshop/customer/manager/fosuser/newid';
457
-				$item->setId( $this->newId( $conn, $path ) );
457
+				$item->setId($this->newId($conn, $path));
458 458
 			}
459 459
 
460
-			$dbm->release( $conn, $dbname );
460
+			$dbm->release($conn, $dbname);
461 461
 		}
462
-		catch( \Exception $e )
462
+		catch (\Exception $e)
463 463
 		{
464
-			$dbm->release( $conn, $dbname );
464
+			$dbm->release($conn, $dbname);
465 465
 			throw $e;
466 466
 		}
467 467
 
468
-		$this->addGroups( $item );
468
+		$this->addGroups($item);
469 469
 
470
-		$item = $this->savePropertyItems( $item, 'customer' );
471
-		$item = $this->saveAddressItems( $item, 'customer' );
472
-		return $this->saveListItems( $item, 'customer' );
470
+		$item = $this->savePropertyItems($item, 'customer');
471
+		$item = $this->saveAddressItems($item, 'customer');
472
+		return $this->saveListItems($item, 'customer');
473 473
 	}
474 474
 
475 475
 
@@ -481,11 +481,11 @@  discard block
 block discarded – undo
481 481
 	 * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface
482 482
 	 * @throws \Aimeos\MShop\Customer\Exception If creating items failed
483 483
 	 */
484
-	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null )
484
+	public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null)
485 485
 	{
486 486
 		$dbm = $this->getContext()->getDatabaseManager();
487 487
 		$dbname = $this->getResourceName();
488
-		$conn = $dbm->acquire( $dbname );
488
+		$conn = $dbm->acquire($dbname);
489 489
 		$map = [];
490 490
 
491 491
 		try
@@ -493,32 +493,32 @@  discard block
 block discarded – undo
493 493
 			$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
494 494
 			$cfgPathSearch = 'mshop/customer/manager/fosuser/search';
495 495
 			$cfgPathCount = 'mshop/customer/manager/fosuser/count';
496
-			$required = array( 'customer' );
496
+			$required = array('customer');
497 497
 
498
-			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
499
-			while( ( $row = $results->fetch() ) !== false ) {
500
-				$map[ $row['customer.id'] ] = $row;
498
+			$results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level);
499
+			while (($row = $results->fetch()) !== false) {
500
+				$map[$row['customer.id']] = $row;
501 501
 			}
502 502
 
503
-			$dbm->release( $conn, $dbname );
503
+			$dbm->release($conn, $dbname);
504 504
 		}
505
-		catch( \Exception $e )
505
+		catch (\Exception $e)
506 506
 		{
507
-			$dbm->release( $conn, $dbname  );
507
+			$dbm->release($conn, $dbname);
508 508
 			throw $e;
509 509
 		}
510 510
 
511 511
 		$addrItems = [];
512
-		if( in_array( 'customer/address', $ref, true ) ) {
513
-			$addrItems = $this->getAddressItems( array_keys( $map ), 'customer' );
512
+		if (in_array('customer/address', $ref, true)) {
513
+			$addrItems = $this->getAddressItems(array_keys($map), 'customer');
514 514
 		}
515 515
 
516 516
 		$propItems = [];
517
-		if( in_array( 'customer/property', $ref, true ) ) {
518
-			$propItems = $this->getPropertyItems( array_keys( $map ), 'customer' );
517
+		if (in_array('customer/property', $ref, true)) {
518
+			$propItems = $this->getPropertyItems(array_keys($map), 'customer');
519 519
 		}
520 520
 
521
-		return $this->buildItems( $map, $ref, 'customer', $addrItems, $propItems );
521
+		return $this->buildItems($map, $ref, 'customer', $addrItems, $propItems);
522 522
 	}
523 523
 
524 524
 
@@ -529,9 +529,9 @@  discard block
 block discarded – undo
529 529
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
530 530
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
531 531
 	 */
532
-	public function getSubManager( $manager, $name = null )
532
+	public function getSubManager($manager, $name = null)
533 533
 	{
534
-		return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'FosUser' : $name ) );
534
+		return $this->getSubManagerBase('customer', $manager, ($name === null ? 'FosUser' : $name));
535 535
 	}
536 536
 
537 537
 
@@ -545,15 +545,15 @@  discard block
 block discarded – undo
545 545
 	 * @param array $propItems List of property items of the customer item
546 546
 	 * @return \Aimeos\MShop\Customer\Item\Iface New customer item
547 547
 	 */
548
-	protected function createItemBase( array $values = [], array $listItems = [], array $refItems = [],
549
-		array $addresses = [], array $propItems = [] )
548
+	protected function createItemBase(array $values = [], array $listItems = [], array $refItems = [],
549
+		array $addresses = [], array $propItems = [])
550 550
 	{
551
-		if( !isset( $this->addressManager ) ) {
552
-			$this->addressManager = $this->getObject()->getSubManager( 'address' );
551
+		if (!isset($this->addressManager)) {
552
+			$this->addressManager = $this->getObject()->getSubManager('address');
553 553
 		}
554 554
 
555
-		if( isset( $values['roles'] ) ) {
556
-			$values['roles'] = unserialize( $values['roles'] );
555
+		if (isset($values['roles'])) {
556
+			$values['roles'] = unserialize($values['roles']);
557 557
 		}
558 558
 
559 559
 		$helper = $this->getPasswordHelper();
Please login to merge, or discard this patch.