Completed
Push — master ( 01ddbd...9c6e06 )
by Aimeos
01:52
created
lib/custom/setup/default/schema/customer.php 1 patch
Spacing   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -8,216 +8,216 @@
 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( 'status', 'smallint', [] );
126
-			$table->addColumn( 'mtime', 'datetime', [] );
127
-			$table->addColumn( 'ctime', 'datetime', [] );
128
-			$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('status', 'smallint', []);
126
+			$table->addColumn('mtime', 'datetime', []);
127
+			$table->addColumn('ctime', 'datetime', []);
128
+			$table->addColumn('editor', 'string', array('length' => 255));
129 129
 
130
-			$table->setPrimaryKey( array( 'id' ), 'pk_foslity_id' );
131
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_foslity_sid_dom_code' );
132
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_foslity_sid_status' );
133
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_foslity_sid_label' );
134
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_foslity_sid_code' );
130
+			$table->setPrimaryKey(array('id'), 'pk_foslity_id');
131
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_foslity_sid_dom_code');
132
+			$table->addIndex(array('siteid', 'status'), 'idx_foslity_sid_status');
133
+			$table->addIndex(array('siteid', 'label'), 'idx_foslity_sid_label');
134
+			$table->addIndex(array('siteid', 'code'), 'idx_foslity_sid_code');
135 135
 
136 136
 			return $schema;
137 137
 		},
138 138
 
139
-		'fos_user_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
140
-
141
-			$table = $schema->createTable( 'fos_user_list' );
142
-
143
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
144
-			$table->addColumn( 'parentid', 'integer', [] );
145
-			$table->addColumn( 'siteid', 'integer', [] );
146
-			$table->addColumn( 'typeid', 'integer', [] );
147
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
148
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
149
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
150
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
151
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
152
-			$table->addColumn( 'pos', 'integer', [] );
153
-			$table->addColumn( 'status', 'smallint', [] );
154
-			$table->addColumn( 'mtime', 'datetime', [] );
155
-			$table->addColumn( 'ctime', 'datetime', [] );
156
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
157
-
158
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosli_id' );
159
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_fosli_sid_dm_rid_tid_pid' );
160
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_fosli_sid_stat_start_end' );
161
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_fosli_pid_sid_rid_dom_tid' );
162
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_fosli_pid_sid_start' );
163
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_fosli_pid_sid_end' );
164
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_fosli_pid_sid_pos' );
165
-
166
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
167
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_pid' );
168
-
169
-			$table->addForeignKeyConstraint( 'fos_user_list_type', array( 'typeid' ), array( 'id' ),
170
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_typeid' );
139
+		'fos_user_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
140
+
141
+			$table = $schema->createTable('fos_user_list');
142
+
143
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
144
+			$table->addColumn('parentid', 'integer', []);
145
+			$table->addColumn('siteid', 'integer', []);
146
+			$table->addColumn('typeid', 'integer', []);
147
+			$table->addColumn('domain', 'string', array('length' => 32));
148
+			$table->addColumn('refid', 'string', array('length' => 32));
149
+			$table->addColumn('start', 'datetime', array('notnull' => false));
150
+			$table->addColumn('end', 'datetime', array('notnull' => false));
151
+			$table->addColumn('config', 'text', array('length' => 0xffff));
152
+			$table->addColumn('pos', 'integer', []);
153
+			$table->addColumn('status', 'smallint', []);
154
+			$table->addColumn('mtime', 'datetime', []);
155
+			$table->addColumn('ctime', 'datetime', []);
156
+			$table->addColumn('editor', 'string', array('length' => 255));
157
+
158
+			$table->setPrimaryKey(array('id'), 'pk_fosli_id');
159
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_fosli_sid_dm_rid_tid_pid');
160
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_fosli_sid_stat_start_end');
161
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_fosli_pid_sid_rid_dom_tid');
162
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_fosli_pid_sid_start');
163
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_fosli_pid_sid_end');
164
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_fosli_pid_sid_pos');
165
+
166
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
167
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_pid');
168
+
169
+			$table->addForeignKeyConstraint('fos_user_list_type', array('typeid'), array('id'),
170
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_typeid');
171 171
 
172 172
 			return $schema;
173 173
 		},
174 174
 
175
-		'fos_user_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
175
+		'fos_user_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
176 176
 
177
-			$table = $schema->createTable( 'fos_user_property_type' );
177
+			$table = $schema->createTable('fos_user_property_type');
178 178
 
179
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
180
-			$table->addColumn( 'siteid', 'integer', [] );
181
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
182
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
183
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
184
-			$table->addColumn( 'status', 'smallint', [] );
185
-			$table->addColumn( 'mtime', 'datetime', [] );
186
-			$table->addColumn( 'ctime', 'datetime', [] );
187
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
179
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
180
+			$table->addColumn('siteid', 'integer', []);
181
+			$table->addColumn('domain', 'string', array('length' => 32));
182
+			$table->addColumn('code', 'string', array('length' => 32));
183
+			$table->addColumn('label', 'string', array('length' => 255));
184
+			$table->addColumn('status', 'smallint', []);
185
+			$table->addColumn('mtime', 'datetime', []);
186
+			$table->addColumn('ctime', 'datetime', []);
187
+			$table->addColumn('editor', 'string', array('length' => 255));
188 188
 
189
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosprty_id' );
190
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_fosprty_sid_dom_code' );
191
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_fosprty_sid_status' );
192
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_fosprty_sid_label' );
193
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_fosprty_sid_code' );
189
+			$table->setPrimaryKey(array('id'), 'pk_fosprty_id');
190
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_fosprty_sid_dom_code');
191
+			$table->addIndex(array('siteid', 'status'), 'idx_fosprty_sid_status');
192
+			$table->addIndex(array('siteid', 'label'), 'idx_fosprty_sid_label');
193
+			$table->addIndex(array('siteid', 'code'), 'idx_fosprty_sid_code');
194 194
 
195 195
 			return $schema;
196 196
 		},
197 197
 
198
-		'fos_user_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
199
-
200
-			$table = $schema->createTable( 'fos_user_property' );
201
-
202
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
203
-			$table->addColumn( 'siteid', 'integer', [] );
204
-			$table->addColumn( 'parentid', 'integer', [] );
205
-			$table->addColumn( 'typeid', 'integer', [] );
206
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
207
-			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
208
-			$table->addColumn( 'mtime', 'datetime', [] );
209
-			$table->addColumn( 'ctime', 'datetime', [] );
210
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
211
-
212
-			$table->setPrimaryKey( array( 'id' ), 'pk_fospr_id' );
213
-			$table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_fospr_sid_tid_lid_value' );
214
-			$table->addIndex( array( 'siteid', 'langid' ), 'idx_fospr_sid_langid' );
215
-			$table->addIndex( array( 'siteid', 'value' ), 'idx_fospr_sid_value' );
216
-			$table->addIndex( array( 'typeid' ), 'fk_fospr_typeid' );
217
-			$table->addIndex( array( 'parentid' ), 'fk_fospr_pid' );
218
-
219
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
220
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_pid' );
198
+		'fos_user_property' => function(\Doctrine\DBAL\Schema\Schema $schema) {
199
+
200
+			$table = $schema->createTable('fos_user_property');
201
+
202
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
203
+			$table->addColumn('siteid', 'integer', []);
204
+			$table->addColumn('parentid', 'integer', []);
205
+			$table->addColumn('typeid', 'integer', []);
206
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
207
+			$table->addColumn('value', 'string', array('length' => 255));
208
+			$table->addColumn('mtime', 'datetime', []);
209
+			$table->addColumn('ctime', 'datetime', []);
210
+			$table->addColumn('editor', 'string', array('length' => 255));
211
+
212
+			$table->setPrimaryKey(array('id'), 'pk_fospr_id');
213
+			$table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_fospr_sid_tid_lid_value');
214
+			$table->addIndex(array('siteid', 'langid'), 'idx_fospr_sid_langid');
215
+			$table->addIndex(array('siteid', 'value'), 'idx_fospr_sid_value');
216
+			$table->addIndex(array('typeid'), 'fk_fospr_typeid');
217
+			$table->addIndex(array('parentid'), 'fk_fospr_pid');
218
+
219
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
220
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_pid');
221 221
 
222 222
 			return $schema;
223 223
 		},
Please login to merge, or discard this patch.
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 test data', 0 );
41
-		$this->additional->setEditor( 'ai-fosuser:unittest' );
40
+		$this->msg('Adding customer property 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/setup/unittest/data/customer-property.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2018
6 6
  */
7 7
 
8
-return array (
8
+return array(
9 9
 	'customer/property/type' => array(
10
-		'customer/property/type/newsletter' => array( 'domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1 ),
10
+		'customer/property/type/newsletter' => array('domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1),
11 11
 	),
12 12
 
13 13
 	'customer/property' => array(
14
-		'customer/property/UTC001/newsletter' => array( 'parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1' ),
14
+		'customer/property/UTC001/newsletter' => array('parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1'),
15 15
 	),
16 16
 );
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Property/FosUserTest.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -20,91 +20,91 @@  discard block
 block discarded – undo
20 20
 		$context = \TestHelper::getContext();
21 21
 		$this->editor = $context->getEditor();
22 22
 
23
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'FosUser' );
24
-		$this->object = $manager->getSubManager( 'property', 'FosUser' );
23
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'FosUser');
24
+		$this->object = $manager->getSubManager('property', 'FosUser');
25 25
 	}
26 26
 
27 27
 
28 28
 	protected function tearDown()
29 29
 	{
30
-		unset( $this->object );
30
+		unset($this->object);
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testCleanup()
35 35
 	{
36
-		$this->object->cleanup( array( -1 ) );
36
+		$this->object->cleanup(array( -1 ));
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateItem()
41 41
 	{
42 42
 		$item = $this->object->createItem();
43
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item );
43
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item);
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testSaveInvalid()
48 48
 	{
49
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
50
-		$this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() );
49
+		$this->setExpectedException('\Aimeos\MShop\Exception');
50
+		$this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard());
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testSaveUpdateDeleteItem()
55 55
 	{
56 56
 		$search = $this->object->createSearch();
57
-		$search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) );
58
-		$results = $this->object->searchItems( $search );
57
+		$search->setConditions($search->compare('==', 'customer.property.editor', $this->editor));
58
+		$results = $this->object->searchItems($search);
59 59
 
60
-		if( ( $item = reset($results) ) === false ) {
61
-			throw new \RuntimeException( 'No property item found' );
60
+		if (($item = reset($results)) === false) {
61
+			throw new \RuntimeException('No property item found');
62 62
 		}
63 63
 
64 64
 		$item->setId(null);
65
-		$item->setLanguageId( 'en' );
66
-		$resultSaved = $this->object->saveItem( $item );
67
-		$itemSaved = $this->object->getItem( $item->getId() );
65
+		$item->setLanguageId('en');
66
+		$resultSaved = $this->object->saveItem($item);
67
+		$itemSaved = $this->object->getItem($item->getId());
68 68
 
69 69
 		$itemExp = clone $itemSaved;
70
-		$itemExp->setValue( 'unittest' );
71
-		$resultUpd = $this->object->saveItem( $itemExp );
72
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
70
+		$itemExp->setValue('unittest');
71
+		$resultUpd = $this->object->saveItem($itemExp);
72
+		$itemUpd = $this->object->getItem($itemExp->getId());
73 73
 
74
-		$this->object->deleteItem( $itemSaved->getId() );
74
+		$this->object->deleteItem($itemSaved->getId());
75 75
 
76 76
 		$context = \TestHelper::getContext();
77 77
 
78
-		$this->assertTrue( $item->getId() !== null );
79
-		$this->assertTrue( $itemSaved->getType() !== null );
80
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
81
-		$this->assertEquals( $item->getParentId(), $itemSaved->getParentId() );
82
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
83
-		$this->assertEquals( $item->getTypeId(), $itemSaved->getTypeId() );
84
-		$this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId() );
85
-		$this->assertEquals( $item->getValue(), $itemSaved->getValue() );
86
-
87
-		$this->assertEquals( $context->getEditor(), $itemSaved->getEditor() );
88
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
89
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
90
-
91
-		$this->assertTrue( $itemUpd->getType() !== null );
92
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
93
-		$this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId() );
94
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
95
-		$this->assertEquals( $itemExp->getTypeId(), $itemUpd->getTypeId() );
96
-		$this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId() );
97
-		$this->assertEquals( $itemExp->getValue(), $itemUpd->getValue() );
98
-
99
-		$this->assertEquals( $context->getEditor(), $itemUpd->getEditor() );
100
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
101
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
102
-
103
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
104
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
105
-
106
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
107
-		$this->object->getItem( $itemSaved->getId() );
78
+		$this->assertTrue($item->getId() !== null);
79
+		$this->assertTrue($itemSaved->getType() !== null);
80
+		$this->assertEquals($item->getId(), $itemSaved->getId());
81
+		$this->assertEquals($item->getParentId(), $itemSaved->getParentId());
82
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
83
+		$this->assertEquals($item->getTypeId(), $itemSaved->getTypeId());
84
+		$this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId());
85
+		$this->assertEquals($item->getValue(), $itemSaved->getValue());
86
+
87
+		$this->assertEquals($context->getEditor(), $itemSaved->getEditor());
88
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
89
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
90
+
91
+		$this->assertTrue($itemUpd->getType() !== null);
92
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
93
+		$this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId());
94
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
95
+		$this->assertEquals($itemExp->getTypeId(), $itemUpd->getTypeId());
96
+		$this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId());
97
+		$this->assertEquals($itemExp->getValue(), $itemUpd->getValue());
98
+
99
+		$this->assertEquals($context->getEditor(), $itemUpd->getEditor());
100
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
101
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
102
+
103
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
104
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
105
+
106
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
107
+		$this->object->getItem($itemSaved->getId());
108 108
 	}
109 109
 
110 110
 
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
 	{
113 113
 		$search = $this->object->createSearch();
114 114
 		$conditions = array(
115
-			$search->compare( '~=', 'customer.property.value', '1'),
116
-			$search->compare( '==', 'customer.property.editor', $this->editor )
115
+			$search->compare('~=', 'customer.property.value', '1'),
116
+			$search->compare('==', 'customer.property.editor', $this->editor)
117 117
 		);
118
-		$search->setConditions( $search->combine( '&&', $conditions ) );
119
-		$results = $this->object->searchItems( $search );
118
+		$search->setConditions($search->combine('&&', $conditions));
119
+		$results = $this->object->searchItems($search);
120 120
 
121
-		if( ($expected = reset($results)) === false ) {
122
-			throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) );
121
+		if (($expected = reset($results)) === false) {
122
+			throw new \RuntimeException(sprintf('No customer property item found for value "%1$s".', '1'));
123 123
 		}
124 124
 
125
-		$actual = $this->object->getItem( $expected->getId() );
126
-		$this->assertNotEquals( '', $actual->getTypeName() );
127
-		$this->assertEquals( $expected, $actual );
125
+		$actual = $this->object->getItem($expected->getId());
126
+		$this->assertNotEquals('', $actual->getTypeName());
127
+		$this->assertEquals($expected, $actual);
128 128
 	}
129 129
 
130 130
 
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 	{
133 133
 		$result = $this->object->getResourceType();
134 134
 
135
-		$this->assertContains( 'customer/property', $result );
136
-		$this->assertContains( 'customer/property/type', $result );
135
+		$this->assertContains('customer/property', $result);
136
+		$this->assertContains('customer/property/type', $result);
137 137
 	}
138 138
 
139 139
 
140 140
 	public function testGetSearchAttributes()
141 141
 	{
142
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
143
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
142
+		foreach ($this->object->getSearchAttributes() as $attribute) {
143
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
144 144
 		}
145 145
 	}
146 146
 
@@ -151,51 +151,51 @@  discard block
 block discarded – undo
151 151
 		$search = $this->object->createSearch();
152 152
 
153 153
 		$expr = [];
154
-		$expr[] = $search->compare( '!=', 'customer.property.id', null );
155
-		$expr[] = $search->compare( '!=', 'customer.property.parentid', null );
156
-		$expr[] = $search->compare( '!=', 'customer.property.siteid', null );
157
-		$expr[] = $search->compare( '!=', 'customer.property.typeid', null );
158
-		$expr[] = $search->compare( '==', 'customer.property.languageid', null );
159
-		$expr[] = $search->compare( '==', 'customer.property.value', '1' );
160
-		$expr[] = $search->compare( '==', 'customer.property.editor', $this->editor );
161
-
162
-		$expr[] = $search->compare( '!=', 'customer.property.type.id', null );
163
-		$expr[] = $search->compare( '!=', 'customer.property.type.siteid', null );
164
-		$expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' );
165
-		$expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' );
166
-		$expr[] = $search->compare( '>', 'customer.property.type.label', '' );
167
-		$expr[] = $search->compare( '==', 'customer.property.type.status', 1 );
168
-		$expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' );
169
-		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
170
-		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
171
-
172
-		$search->setConditions( $search->combine('&&', $expr) );
173
-		$results = $this->object->searchItems( $search, [], $total );
174
-		$this->assertEquals( 1, count( $results ) );
154
+		$expr[] = $search->compare('!=', 'customer.property.id', null);
155
+		$expr[] = $search->compare('!=', 'customer.property.parentid', null);
156
+		$expr[] = $search->compare('!=', 'customer.property.siteid', null);
157
+		$expr[] = $search->compare('!=', 'customer.property.typeid', null);
158
+		$expr[] = $search->compare('==', 'customer.property.languageid', null);
159
+		$expr[] = $search->compare('==', 'customer.property.value', '1');
160
+		$expr[] = $search->compare('==', 'customer.property.editor', $this->editor);
161
+
162
+		$expr[] = $search->compare('!=', 'customer.property.type.id', null);
163
+		$expr[] = $search->compare('!=', 'customer.property.type.siteid', null);
164
+		$expr[] = $search->compare('==', 'customer.property.type.domain', 'customer');
165
+		$expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter');
166
+		$expr[] = $search->compare('>', 'customer.property.type.label', '');
167
+		$expr[] = $search->compare('==', 'customer.property.type.status', 1);
168
+		$expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00');
169
+		$expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00');
170
+		$expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor);
171
+
172
+		$search->setConditions($search->combine('&&', $expr));
173
+		$results = $this->object->searchItems($search, [], $total);
174
+		$this->assertEquals(1, count($results));
175 175
 
176 176
 
177 177
 		$search = $this->object->createSearch();
178 178
 		$conditions = array(
179
-			$search->compare( '=~', 'customer.property.type.code', 'newsletter' ),
180
-			$search->compare( '==', 'customer.property.editor', $this->editor )
179
+			$search->compare('=~', 'customer.property.type.code', 'newsletter'),
180
+			$search->compare('==', 'customer.property.editor', $this->editor)
181 181
 		);
182
-		$search->setConditions( $search->combine( '&&', $conditions ) );
182
+		$search->setConditions($search->combine('&&', $conditions));
183 183
 		$search->setSlice(0, 1);
184
-		$items = $this->object->searchItems( $search, [], $total );
184
+		$items = $this->object->searchItems($search, [], $total);
185 185
 
186
-		$this->assertEquals( 1, count( $items ) );
187
-		$this->assertEquals( 1, $total );
186
+		$this->assertEquals(1, count($items));
187
+		$this->assertEquals(1, $total);
188 188
 
189
-		foreach($items as $itemId => $item) {
190
-			$this->assertEquals( $itemId, $item->getId() );
189
+		foreach ($items as $itemId => $item) {
190
+			$this->assertEquals($itemId, $item->getId());
191 191
 		}
192 192
 	}
193 193
 
194 194
 
195 195
 	public function testGetSubManager()
196 196
 	{
197
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') );
198
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') );
197
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type'));
198
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard'));
199 199
 
200 200
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
201 201
 		$this->object->getSubManager('unknown');
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Property/Type/FosUserTest.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 		$context = \TestHelper::getContext();
21 21
 		$this->editor = $context->getEditor();
22 22
 
23
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'FosUser' );
24
-		$this->object = $manager->getSubManager( 'property', 'FosUser' )->getSubManager( 'type', 'FosUser' );
23
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'FosUser');
24
+		$this->object = $manager->getSubManager('property', 'FosUser')->getSubManager('type', 'FosUser');
25 25
 	}
26 26
 
27 27
 
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 
34 34
 	public function testCleanup()
35 35
 	{
36
-		$this->object->cleanup( array( -1 ) );
36
+		$this->object->cleanup(array( -1 ));
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateItem()
41 41
 	{
42
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem() );
42
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem());
43 43
 	}
44 44
 
45 45
 
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		$result = $this->object->getResourceType();
49 49
 
50
-		$this->assertContains( 'customer/property/type', $result );
50
+		$this->assertContains('customer/property/type', $result);
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testGetSearchAttributes()
55 55
 	{
56
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
57
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
56
+		foreach ($this->object->getSearchAttributes() as $attribute) {
57
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
58 58
 		}
59 59
 	}
60 60
 
@@ -63,82 +63,82 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$search = $this->object->createSearch();
65 65
 		$conditions = array(
66
-			$search->compare( '==', 'customer.property.type.code', 'newsletter' ),
67
-			$search->compare( '==', 'customer.property.type.editor', $this->editor )
66
+			$search->compare('==', 'customer.property.type.code', 'newsletter'),
67
+			$search->compare('==', 'customer.property.type.editor', $this->editor)
68 68
 		);
69
-		$search->setConditions( $search->combine( '&&', $conditions ) );
69
+		$search->setConditions($search->combine('&&', $conditions));
70 70
 
71
-		$results = $this->object->searchItems( $search );
71
+		$results = $this->object->searchItems($search);
72 72
 
73
-		if( ($expected = reset($results) ) === false )
73
+		if (($expected = reset($results)) === false)
74 74
 		{
75
-			throw new \RuntimeException( 'No property type item found.' );
75
+			throw new \RuntimeException('No property type item found.');
76 76
 		}
77 77
 
78
-		$actual = $this->object->getItem( $expected->getId() );
78
+		$actual = $this->object->getItem($expected->getId());
79 79
 
80
-		$this->assertEquals( $expected, $actual );
80
+		$this->assertEquals($expected, $actual);
81 81
 	}
82 82
 
83 83
 
84 84
 	public function testSaveInvalid()
85 85
 	{
86
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
87
-		$this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() );
86
+		$this->setExpectedException('\Aimeos\MShop\Exception');
87
+		$this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard());
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testSaveUpdateDeleteItem()
92 92
 	{
93 93
 		$search = $this->object->createSearch();
94
-		$search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) );
94
+		$search->setConditions($search->compare('==', 'customer.property.type.editor', $this->editor));
95 95
 		$results = $this->object->searchItems($search);
96 96
 
97
-		if( ( $item = reset($results) ) === false ) {
98
-			throw new \RuntimeException( 'No type item found' );
97
+		if (($item = reset($results)) === false) {
98
+			throw new \RuntimeException('No type item found');
99 99
 		}
100 100
 
101 101
 		$item->setId(null);
102
-		$item->setCode( 'unitTestSave' );
103
-		$resultSaved = $this->object->saveItem( $item );
104
-		$itemSaved = $this->object->getItem( $item->getId() );
102
+		$item->setCode('unitTestSave');
103
+		$resultSaved = $this->object->saveItem($item);
104
+		$itemSaved = $this->object->getItem($item->getId());
105 105
 
106 106
 		$itemExp = clone $itemSaved;
107
-		$itemExp->setCode( 'unitTestSave2' );
108
-		$resultUpd = $this->object->saveItem( $itemExp );
109
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
107
+		$itemExp->setCode('unitTestSave2');
108
+		$resultUpd = $this->object->saveItem($itemExp);
109
+		$itemUpd = $this->object->getItem($itemExp->getId());
110 110
 
111
-		$this->object->deleteItem( $itemSaved->getId() );
111
+		$this->object->deleteItem($itemSaved->getId());
112 112
 
113 113
 
114
-		$this->assertTrue( $item->getId() !== null );
115
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
116
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
117
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
118
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
119
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
120
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
114
+		$this->assertTrue($item->getId() !== null);
115
+		$this->assertEquals($item->getId(), $itemSaved->getId());
116
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
117
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
118
+		$this->assertEquals($item->getDomain(), $itemSaved->getDomain());
119
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
120
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
121 121
 
122
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
123
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
124
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
122
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
123
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
124
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
125 125
 
126
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
127
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
128
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
129
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
130
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
131
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
126
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
127
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
128
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
129
+		$this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain());
130
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
131
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
132 132
 
133
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
134
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
135
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
133
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
134
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
135
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
136 136
 
137
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
138
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
137
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
138
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
139 139
 
140
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
141
-		$this->object->getItem( $itemSaved->getId() );
140
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
141
+		$this->object->getItem($itemSaved->getId());
142 142
 	}
143 143
 
144 144
 
@@ -148,35 +148,35 @@  discard block
 block discarded – undo
148 148
 		$search = $this->object->createSearch();
149 149
 
150 150
 		$expr = [];
151
-		$expr[] = $search->compare( '!=', 'customer.property.type.id', null );
152
-		$expr[] = $search->compare( '!=', 'customer.property.type.siteid', null );
153
-		$expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' );
154
-		$expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' );
155
-		$expr[] = $search->compare( '>', 'customer.property.type.label', '' );
156
-		$expr[] = $search->compare( '==', 'customer.property.type.status', 1 );
157
-		$expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' );
158
-		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
159
-		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
151
+		$expr[] = $search->compare('!=', 'customer.property.type.id', null);
152
+		$expr[] = $search->compare('!=', 'customer.property.type.siteid', null);
153
+		$expr[] = $search->compare('==', 'customer.property.type.domain', 'customer');
154
+		$expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter');
155
+		$expr[] = $search->compare('>', 'customer.property.type.label', '');
156
+		$expr[] = $search->compare('==', 'customer.property.type.status', 1);
157
+		$expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00');
158
+		$expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00');
159
+		$expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor);
160 160
 
161
-		$search->setConditions( $search->combine('&&', $expr) );
162
-		$results = $this->object->searchItems( $search, [], $total );
163
-		$this->assertEquals( 1, count( $results ) );
161
+		$search->setConditions($search->combine('&&', $expr));
162
+		$results = $this->object->searchItems($search, [], $total);
163
+		$this->assertEquals(1, count($results));
164 164
 
165 165
 
166 166
 		$search = $this->object->createSearch();
167 167
 		$conditions = array(
168
-			$search->compare( '=~', 'customer.property.type.code', 'newsletter'),
169
-			$search->compare( '==', 'customer.property.type.editor', $this->editor )
168
+			$search->compare('=~', 'customer.property.type.code', 'newsletter'),
169
+			$search->compare('==', 'customer.property.type.editor', $this->editor)
170 170
 		);
171
-		$search->setConditions( $search->combine('&&', $conditions ) );
171
+		$search->setConditions($search->combine('&&', $conditions));
172 172
 		$search->setSlice(0, 1);
173
-		$items = $this->object->searchItems( $search, [], $total);
173
+		$items = $this->object->searchItems($search, [], $total);
174 174
 
175
-		$this->assertEquals( 1, count( $items ) );
176
-		$this->assertEquals( 1, $total );
175
+		$this->assertEquals(1, count($items));
176
+		$this->assertEquals(1, $total);
177 177
 
178
-		foreach($items as $itemId => $item) {
179
-			$this->assertEquals( $itemId, $item->getId() );
178
+		foreach ($items as $itemId => $item) {
179
+			$this->assertEquals($itemId, $item->getId());
180 180
 		}
181 181
 	}
182 182
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Property/FosUser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		'customer.property.id' => array(
26 26
 			'code' => 'customer.property.id',
27 27
 			'internalcode' => 'fospr."id"',
28
-			'internaldeps'=>array( 'LEFT JOIN "fos_user_property" AS fospr ON ( fospr."parentid" = fos."id" )' ),
28
+			'internaldeps'=>array('LEFT JOIN "fos_user_property" AS fospr ON ( fospr."parentid" = fos."id" )'),
29 29
 			'label' => 'Property ID',
30 30
 			'type' => 'integer',
31 31
 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
103 103
 	 */
104
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
104
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context)
105 105
 	{
106
-		parent::__construct( $context );
107
-		$this->setResourceName( 'db-customer' );
106
+		parent::__construct($context);
107
+		$this->setResourceName('db-customer');
108 108
 	}
109 109
 
110 110
 
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
 	 *
114 114
 	 * @param integer[] $siteids List of IDs for sites whose entries should be deleted
115 115
 	 */
116
-	public function cleanup( array $siteids )
116
+	public function cleanup(array $siteids)
117 117
 	{
118 118
 		$path = 'mshop/customer/manager/property/submanagers';
119
-		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
120
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
119
+		foreach ($this->getContext()->getConfig()->get($path, []) as $domain) {
120
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
121 121
 		}
122 122
 
123
-		$this->cleanupBase( $siteids, 'mshop/customer/manager/property/fosuser/delete' );
123
+		$this->cleanupBase($siteids, 'mshop/customer/manager/property/fosuser/delete');
124 124
 	}
125 125
 
126 126
 
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 	 * @param boolean $withsub Return also the resource type of sub-managers if true
131 131
 	 * @return array Type of the manager and submanagers, subtypes are separated by slashes
132 132
 	 */
133
-	public function getResourceType( $withsub = true )
133
+	public function getResourceType($withsub = true)
134 134
 	{
135 135
 		$path = 'mshop/customer/manager/property/submanagers';
136 136
 
137
-		return $this->getResourceTypeBase( 'customer/property', $path, array( 'type' ), $withsub );
137
+		return $this->getResourceTypeBase('customer/property', $path, array('type'), $withsub);
138 138
 	}
139 139
 
140 140
 
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 	 * @param boolean $withsub Return also attributes of sub-managers if true
145 145
 	 * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface
146 146
 	 */
147
-	public function getSearchAttributes( $withsub = true )
147
+	public function getSearchAttributes($withsub = true)
148 148
 	{
149 149
 		$path = 'mshop/customer/manager/property/submanagers';
150 150
 
151
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, array( 'type' ), $withsub );
151
+		return $this->getSearchAttributesBase($this->searchConfig, $path, array('type'), $withsub);
152 152
 	}
153 153
 
154 154
 
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
 	 * configuration (or Default) if null
161 161
 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g property types, property lists etc.
162 162
 	 */
163
-	public function getSubManager( $manager, $name = null )
163
+	public function getSubManager($manager, $name = null)
164 164
 	{
165
-		return $this->getSubManagerBase( 'customer', 'property/' . $manager, ( $name === null ? 'FosUser' : $name ) );
165
+		return $this->getSubManagerBase('customer', 'property/' . $manager, ($name === null ? 'FosUser' : $name));
166 166
 	}
167 167
 
168 168
 
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Property/Type/FosUser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		'customer.property.type.id' => array(
26 26
 			'code' => 'customer.property.type.id',
27 27
 			'internalcode' => 'fosprty."id"',
28
-			'internaldeps' => array( 'LEFT JOIN "fos_user_property_type" AS fosprty ON ( fospr."typeid" = fosprty."id" )' ),
28
+			'internaldeps' => array('LEFT JOIN "fos_user_property_type" AS fosprty ON ( fospr."typeid" = fosprty."id" )'),
29 29
 			'label' => 'Property type ID',
30 30
 			'type' => 'integer',
31 31
 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
101 101
 	 */
102
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
102
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context)
103 103
 	{
104
-		parent::__construct( $context );
105
-		$this->setResourceName( 'db-customer' );
104
+		parent::__construct($context);
105
+		$this->setResourceName('db-customer');
106 106
 	}
107 107
 
108 108
 
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	 *
112 112
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
113 113
 	 */
114
-	public function cleanup( array $siteids )
114
+	public function cleanup(array $siteids)
115 115
 	{
116 116
 		$path = 'mshop/customer/manager/property/type/submanagers';
117
-		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) {
118
-			$this->getObject()->getSubManager( $domain )->cleanup( $siteids );
117
+		foreach ($this->getContext()->getConfig()->get($path, []) as $domain) {
118
+			$this->getObject()->getSubManager($domain)->cleanup($siteids);
119 119
 		}
120 120
 
121
-		$this->cleanupBase( $siteids, 'mshop/customer/manager/property/type/fosuser/delete' );
121
+		$this->cleanupBase($siteids, 'mshop/customer/manager/property/type/fosuser/delete');
122 122
 	}
123 123
 
124 124
 
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 	 * @param boolean $withsub Return also the resource type of sub-managers if true
129 129
 	 * @return array Type of the manager and submanagers, subtypes are separated by slashes
130 130
 	 */
131
-	public function getResourceType( $withsub = true )
131
+	public function getResourceType($withsub = true)
132 132
 	{
133 133
 		$path = 'mshop/customer/manager/property/type/submanagers';
134 134
 
135
-		return $this->getResourceTypeBase( 'customer/property/type', $path, [], $withsub );
135
+		return $this->getResourceTypeBase('customer/property/type', $path, [], $withsub);
136 136
 	}
137 137
 
138 138
 
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	 * @param boolean $withsub Return also attributes of sub-managers if true
143 143
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
144 144
 	 */
145
-	public function getSearchAttributes( $withsub = true )
145
+	public function getSearchAttributes($withsub = true)
146 146
 	{
147 147
 		$path = 'mshop/customer/manager/property/type/submanagers';
148 148
 
149
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub );
149
+		return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub);
150 150
 	}
151 151
 
152 152
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
158 158
 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g types, lists etc.
159 159
 	 */
160
-	public function getSubManager( $manager, $name = null )
160
+	public function getSubManager($manager, $name = null)
161 161
 	{
162
-		return $this->getSubManagerBase( 'customer', 'property/type/' . $manager, $name );
162
+		return $this->getSubManagerBase('customer', 'property/type/' . $manager, $name);
163 163
 	}
164 164
 
165 165
 
Please login to merge, or discard this patch.