@@ -8,206 +8,206 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'users' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | - |
|
13 | - $table = $schema->createTable( 'users' ); |
|
14 | - |
|
15 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
16 | - $table->addColumn( 'superuser', 'smallint', array( 'default' => 0 ) ); |
|
17 | - $table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) ); |
|
18 | - $table->addColumn( 'label', 'string', array( 'length' => 255, 'default' => '' ) ); |
|
19 | - $table->addColumn( 'name', 'string', array( 'length' => 255 ) ); |
|
20 | - $table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) ); |
|
21 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8, 'default' => '' ) ); |
|
22 | - $table->addColumn( 'company', 'string', array( 'length' => 100, 'default' => '' ) ); |
|
23 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
24 | - $table->addColumn( 'title', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
25 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
26 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
27 | - $table->addColumn( 'address1', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
28 | - $table->addColumn( 'address2', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
29 | - $table->addColumn( 'address3', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
30 | - $table->addColumn( 'postal', 'string', array( 'length' => 16, 'default' => '' ) ); |
|
31 | - $table->addColumn( 'city', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
32 | - $table->addColumn( 'state', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
33 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
34 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
35 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
36 | - $table->addColumn( 'telefax', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
37 | - $table->addColumn( 'website', 'string', array( 'length' => 255, 'default' => '' ) ); |
|
38 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
39 | - $table->addColumn( 'password', 'string', array( 'length' => 255 ) ); |
|
40 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
41 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
42 | - $table->addColumn( 'birthday', 'date', array( 'notnull' => false ) ); |
|
43 | - $table->addColumn( 'vdate', 'date', array( 'notnull' => false ) ); |
|
44 | - $table->addColumn( 'status', 'smallint', array( 'default' => 1 ) ); |
|
45 | - $table->addColumn( 'updated_at', 'datetime', [] ); |
|
46 | - $table->addColumn( 'created_at', 'datetime', [] ); |
|
47 | - $table->addColumn( 'editor', 'string', array('length' => 255, 'default' => '' ) ); |
|
48 | - |
|
49 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' ); |
|
50 | - $table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' ); |
|
51 | - $table->addIndex( array( 'langid' ), 'idx_lvusr_langid' ); |
|
52 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' ); |
|
53 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' ); |
|
54 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' ); |
|
55 | - $table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' ); |
|
56 | - $table->addIndex( array( 'address1' ), 'idx_lvusr_address1' ); |
|
57 | - $table->addIndex( array( 'city' ), 'idx_lvusr_city' ); |
|
11 | + 'users' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | + |
|
13 | + $table = $schema->createTable('users'); |
|
14 | + |
|
15 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
16 | + $table->addColumn('superuser', 'smallint', array('default' => 0)); |
|
17 | + $table->addColumn('siteid', 'integer', array('notnull' => false)); |
|
18 | + $table->addColumn('label', 'string', array('length' => 255, 'default' => '')); |
|
19 | + $table->addColumn('name', 'string', array('length' => 255)); |
|
20 | + $table->addColumn('remember_token', 'string', array('length' => 100, 'notnull' => false)); |
|
21 | + $table->addColumn('salutation', 'string', array('length' => 8, 'default' => '')); |
|
22 | + $table->addColumn('company', 'string', array('length' => 100, 'default' => '')); |
|
23 | + $table->addColumn('vatid', 'string', array('length' => 32, 'default' => '')); |
|
24 | + $table->addColumn('title', 'string', array('length' => 64, 'default' => '')); |
|
25 | + $table->addColumn('firstname', 'string', array('length' => 64, 'default' => '')); |
|
26 | + $table->addColumn('lastname', 'string', array('length' => 64, 'default' => '')); |
|
27 | + $table->addColumn('address1', 'string', array('length' => 200, 'default' => '')); |
|
28 | + $table->addColumn('address2', 'string', array('length' => 200, 'default' => '')); |
|
29 | + $table->addColumn('address3', 'string', array('length' => 200, 'default' => '')); |
|
30 | + $table->addColumn('postal', 'string', array('length' => 16, 'default' => '')); |
|
31 | + $table->addColumn('city', 'string', array('length' => 200, 'default' => '')); |
|
32 | + $table->addColumn('state', 'string', array('length' => 200, 'default' => '')); |
|
33 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
34 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
35 | + $table->addColumn('telephone', 'string', array('length' => 32, 'default' => '')); |
|
36 | + $table->addColumn('telefax', 'string', array('length' => 32, 'default' => '')); |
|
37 | + $table->addColumn('website', 'string', array('length' => 255, 'default' => '')); |
|
38 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
39 | + $table->addColumn('password', 'string', array('length' => 255)); |
|
40 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
41 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
42 | + $table->addColumn('birthday', 'date', array('notnull' => false)); |
|
43 | + $table->addColumn('vdate', 'date', array('notnull' => false)); |
|
44 | + $table->addColumn('status', 'smallint', array('default' => 1)); |
|
45 | + $table->addColumn('updated_at', 'datetime', []); |
|
46 | + $table->addColumn('created_at', 'datetime', []); |
|
47 | + $table->addColumn('editor', 'string', array('length' => 255, 'default' => '')); |
|
48 | + |
|
49 | + $table->setPrimaryKey(array('id'), 'pk_lvusr_id'); |
|
50 | + $table->addUniqueIndex(array('email'), 'unq_lvusr_email'); |
|
51 | + $table->addIndex(array('langid'), 'idx_lvusr_langid'); |
|
52 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvusr_last_first'); |
|
53 | + $table->addIndex(array('postal', 'address1'), 'idx_lvusr_post_addr1'); |
|
54 | + $table->addIndex(array('postal', 'city'), 'idx_lvusr_post_city'); |
|
55 | + $table->addIndex(array('lastname'), 'idx_lvusr_lastname'); |
|
56 | + $table->addIndex(array('address1'), 'idx_lvusr_address1'); |
|
57 | + $table->addIndex(array('city'), 'idx_lvusr_city'); |
|
58 | 58 | |
59 | 59 | return $schema; |
60 | 60 | }, |
61 | 61 | |
62 | - 'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
63 | - |
|
64 | - $table = $schema->createTable( 'users_address' ); |
|
65 | - |
|
66 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
67 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
68 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
69 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
70 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
71 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
72 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
73 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
74 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
75 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
76 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
77 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
78 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
79 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
80 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
81 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
82 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
83 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
84 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
85 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
86 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
87 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
88 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
89 | - $table->addColumn( 'flag', 'integer', [] ); |
|
90 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
91 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
92 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
93 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
94 | - |
|
95 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' ); |
|
96 | - $table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' ); |
|
97 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' ); |
|
98 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' ); |
|
99 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' ); |
|
100 | - $table->addIndex( array( 'address1' ), 'idx_lvuad_address1' ); |
|
101 | - $table->addIndex( array( 'city' ), 'idx_lvuad_city' ); |
|
102 | - $table->addIndex( array( 'email' ), 'idx_lvuad_email' ); |
|
62 | + 'users_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
63 | + |
|
64 | + $table = $schema->createTable('users_address'); |
|
65 | + |
|
66 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
67 | + $table->addColumn('siteid', 'integer', []); |
|
68 | + $table->addColumn('parentid', 'integer', []); |
|
69 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
70 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
71 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
72 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
73 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
74 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
75 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
76 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
77 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
78 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
79 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
80 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
81 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
82 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
83 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
84 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
85 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
86 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
87 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
88 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
89 | + $table->addColumn('flag', 'integer', []); |
|
90 | + $table->addColumn('pos', 'smallint', []); |
|
91 | + $table->addColumn('mtime', 'datetime', []); |
|
92 | + $table->addColumn('ctime', 'datetime', []); |
|
93 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
94 | + |
|
95 | + $table->setPrimaryKey(array('id'), 'pk_lvuad_id'); |
|
96 | + $table->addIndex(array('parentid'), 'idx_lvuad_pid'); |
|
97 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvuad_last_first'); |
|
98 | + $table->addIndex(array('postal', 'address1'), 'idx_lvuad_post_addr1'); |
|
99 | + $table->addIndex(array('postal', 'city'), 'idx_lvuad_post_city'); |
|
100 | + $table->addIndex(array('address1'), 'idx_lvuad_address1'); |
|
101 | + $table->addIndex(array('city'), 'idx_lvuad_city'); |
|
102 | + $table->addIndex(array('email'), 'idx_lvuad_email'); |
|
103 | 103 | |
104 | 104 | return $schema; |
105 | 105 | }, |
106 | 106 | |
107 | - 'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
107 | + 'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
108 | 108 | |
109 | - $table = $schema->createTable( 'users_list_type' ); |
|
109 | + $table = $schema->createTable('users_list_type'); |
|
110 | 110 | |
111 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
112 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
113 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
114 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
115 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
116 | - $table->addColumn( 'pos', 'integer', [] ); |
|
117 | - $table->addColumn( 'status', 'smallint', [] ); |
|
118 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
119 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
120 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
111 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
112 | + $table->addColumn('siteid', 'integer', []); |
|
113 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
114 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
115 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
116 | + $table->addColumn('pos', 'integer', []); |
|
117 | + $table->addColumn('status', 'smallint', []); |
|
118 | + $table->addColumn('mtime', 'datetime', []); |
|
119 | + $table->addColumn('ctime', 'datetime', []); |
|
120 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
121 | 121 | |
122 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' ); |
|
123 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' ); |
|
124 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvulity_sid_status_pos' ); |
|
125 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' ); |
|
126 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' ); |
|
122 | + $table->setPrimaryKey(array('id'), 'pk_lvulity_id'); |
|
123 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code'); |
|
124 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvulity_sid_status_pos'); |
|
125 | + $table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label'); |
|
126 | + $table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code'); |
|
127 | 127 | |
128 | 128 | return $schema; |
129 | 129 | }, |
130 | 130 | |
131 | - 'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
132 | - |
|
133 | - $table = $schema->createTable( 'users_list' ); |
|
134 | - |
|
135 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
136 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
137 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
138 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
139 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
140 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
141 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
142 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
143 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
144 | - $table->addColumn( 'pos', 'integer', [] ); |
|
145 | - $table->addColumn( 'status', 'smallint', [] ); |
|
146 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
147 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
148 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
149 | - |
|
150 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' ); |
|
151 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' ); |
|
152 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' ); |
|
153 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' ); |
|
154 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' ); |
|
155 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' ); |
|
156 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' ); |
|
157 | - |
|
158 | - $table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ), |
|
159 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' ); |
|
131 | + 'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
132 | + |
|
133 | + $table = $schema->createTable('users_list'); |
|
134 | + |
|
135 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
136 | + $table->addColumn('parentid', 'integer', []); |
|
137 | + $table->addColumn('siteid', 'integer', []); |
|
138 | + $table->addColumn('typeid', 'integer', []); |
|
139 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
140 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
141 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
142 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
143 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
144 | + $table->addColumn('pos', 'integer', []); |
|
145 | + $table->addColumn('status', 'smallint', []); |
|
146 | + $table->addColumn('mtime', 'datetime', []); |
|
147 | + $table->addColumn('ctime', 'datetime', []); |
|
148 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
149 | + |
|
150 | + $table->setPrimaryKey(array('id'), 'pk_lvuli_id'); |
|
151 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid'); |
|
152 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end'); |
|
153 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid'); |
|
154 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start'); |
|
155 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end'); |
|
156 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos'); |
|
157 | + |
|
158 | + $table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'), |
|
159 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid'); |
|
160 | 160 | |
161 | 161 | return $schema; |
162 | 162 | }, |
163 | 163 | |
164 | - 'users_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
164 | + 'users_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
165 | 165 | |
166 | - $table = $schema->createTable( 'users_property_type' ); |
|
166 | + $table = $schema->createTable('users_property_type'); |
|
167 | 167 | |
168 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
169 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
170 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
171 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
172 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
173 | - $table->addColumn( 'pos', 'integer', [] ); |
|
174 | - $table->addColumn( 'status', 'smallint', [] ); |
|
175 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
176 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
177 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
168 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
169 | + $table->addColumn('siteid', 'integer', []); |
|
170 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
171 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
172 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
173 | + $table->addColumn('pos', 'integer', []); |
|
174 | + $table->addColumn('status', 'smallint', []); |
|
175 | + $table->addColumn('mtime', 'datetime', []); |
|
176 | + $table->addColumn('ctime', 'datetime', []); |
|
177 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
178 | 178 | |
179 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuprty_id' ); |
|
180 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvuprty_sid_dom_code' ); |
|
181 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvuprty_sid_status_pos' ); |
|
182 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvuprty_sid_label' ); |
|
183 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvuprty_sid_code' ); |
|
179 | + $table->setPrimaryKey(array('id'), 'pk_lvuprty_id'); |
|
180 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvuprty_sid_dom_code'); |
|
181 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvuprty_sid_status_pos'); |
|
182 | + $table->addIndex(array('siteid', 'label'), 'idx_lvuprty_sid_label'); |
|
183 | + $table->addIndex(array('siteid', 'code'), 'idx_lvuprty_sid_code'); |
|
184 | 184 | |
185 | 185 | return $schema; |
186 | 186 | }, |
187 | 187 | |
188 | - 'users_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
189 | - |
|
190 | - $table = $schema->createTable( 'users_property' ); |
|
191 | - |
|
192 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
193 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
194 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
195 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
196 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
197 | - $table->addColumn( 'value', 'string', array( 'length' => 255 ) ); |
|
198 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
199 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
200 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
201 | - |
|
202 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvupr_id' ); |
|
203 | - $table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_lvupr_sid_tid_lid_value' ); |
|
204 | - $table->addIndex( array( 'siteid', 'langid' ), 'idx_lvupr_sid_langid' ); |
|
205 | - $table->addIndex( array( 'siteid', 'value' ), 'idx_lvupr_sid_value' ); |
|
206 | - $table->addIndex( array( 'typeid' ), 'fk_lvupr_typeid' ); |
|
207 | - $table->addIndex( array( 'parentid' ), 'fk_lvupr_pid' ); |
|
208 | - |
|
209 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
210 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_pid' ); |
|
188 | + 'users_property' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
189 | + |
|
190 | + $table = $schema->createTable('users_property'); |
|
191 | + |
|
192 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
193 | + $table->addColumn('siteid', 'integer', []); |
|
194 | + $table->addColumn('parentid', 'integer', []); |
|
195 | + $table->addColumn('typeid', 'integer', []); |
|
196 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
197 | + $table->addColumn('value', 'string', array('length' => 255)); |
|
198 | + $table->addColumn('mtime', 'datetime', []); |
|
199 | + $table->addColumn('ctime', 'datetime', []); |
|
200 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
201 | + |
|
202 | + $table->setPrimaryKey(array('id'), 'pk_lvupr_id'); |
|
203 | + $table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_lvupr_sid_tid_lid_value'); |
|
204 | + $table->addIndex(array('siteid', 'langid'), 'idx_lvupr_sid_langid'); |
|
205 | + $table->addIndex(array('siteid', 'value'), 'idx_lvupr_sid_value'); |
|
206 | + $table->addIndex(array('typeid'), 'fk_lvupr_typeid'); |
|
207 | + $table->addIndex(array('parentid'), 'fk_lvupr_pid'); |
|
208 | + |
|
209 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
210 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_pid'); |
|
211 | 211 | |
212 | 212 | return $schema; |
213 | 213 | }, |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | $context = \TestHelper::getContext(); |
21 | 21 | $this->editor = $context->getEditor(); |
22 | 22 | |
23 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Laravel' ); |
|
24 | - $this->object = $manager->getSubManager( 'property', 'Laravel' )->getSubManager( 'type', 'Laravel' ); |
|
23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Laravel'); |
|
24 | + $this->object = $manager->getSubManager('property', 'Laravel')->getSubManager('type', 'Laravel'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -33,13 +33,13 @@ discard block |
||
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 |
||
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 |
||
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,36 +148,36 @@ discard block |
||
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.position', 0 ); |
|
157 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
158 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
159 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
160 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
161 | - |
|
162 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
163 | - $results = $this->object->searchItems( $search, [], $total ); |
|
164 | - $this->assertEquals( 1, count( $results ) ); |
|
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.position', 0); |
|
157 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
158 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
159 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
160 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
161 | + |
|
162 | + $search->setConditions($search->combine('&&', $expr)); |
|
163 | + $results = $this->object->searchItems($search, [], $total); |
|
164 | + $this->assertEquals(1, count($results)); |
|
165 | 165 | |
166 | 166 | |
167 | 167 | $search = $this->object->createSearch(); |
168 | 168 | $conditions = array( |
169 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
170 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
169 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
170 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
171 | 171 | ); |
172 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
172 | + $search->setConditions($search->combine('&&', $conditions)); |
|
173 | 173 | $search->setSlice(0, 1); |
174 | - $items = $this->object->searchItems( $search, [], $total); |
|
174 | + $items = $this->object->searchItems($search, [], $total); |
|
175 | 175 | |
176 | - $this->assertEquals( 1, count( $items ) ); |
|
177 | - $this->assertEquals( 1, $total ); |
|
176 | + $this->assertEquals(1, count($items)); |
|
177 | + $this->assertEquals(1, $total); |
|
178 | 178 | |
179 | - foreach($items as $itemId => $item) { |
|
180 | - $this->assertEquals( $itemId, $item->getId() ); |
|
179 | + foreach ($items as $itemId => $item) { |
|
180 | + $this->assertEquals($itemId, $item->getId()); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 |
@@ -16,29 +16,29 @@ discard block |
||
16 | 16 | protected function setUp() |
17 | 17 | { |
18 | 18 | $this->editor = \TestHelper::getContext()->getEditor(); |
19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Laravel' ); |
|
19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Laravel'); |
|
20 | 20 | |
21 | - $listManager = $manager->getSubManager( 'lists', 'Laravel' ); |
|
22 | - $this->object = $listManager->getSubManager( 'type', 'Laravel' ); |
|
21 | + $listManager = $manager->getSubManager('lists', 'Laravel'); |
|
22 | + $this->object = $listManager->getSubManager('type', 'Laravel'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - unset( $this->object ); |
|
28 | + unset($this->object); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCleanup() |
33 | 33 | { |
34 | - $this->object->cleanup( array( -1 ) ); |
|
34 | + $this->object->cleanup(array( -1 )); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateItem() |
39 | 39 | { |
40 | 40 | $item = $this->object->createItem(); |
41 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
41 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -48,18 +48,18 @@ discard block |
||
48 | 48 | $search->setSlice(0, 1); |
49 | 49 | $results = $this->object->searchItems($search); |
50 | 50 | |
51 | - if( ( $expected = reset($results) ) === false ) { |
|
52 | - throw new \RuntimeException( 'No list type item found' ); |
|
51 | + if (($expected = reset($results)) === false) { |
|
52 | + throw new \RuntimeException('No list type item found'); |
|
53 | 53 | } |
54 | 54 | |
55 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
55 | + $this->assertEquals($expected, $this->object->getItem($expected->getId())); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | 59 | public function testGetSubManager() |
60 | 60 | { |
61 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
62 | - $this->object->getSubManager( 'unknown' ); |
|
61 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
62 | + $this->object->getSubManager('unknown'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -69,51 +69,51 @@ discard block |
||
69 | 69 | $search->setSlice(0, 1); |
70 | 70 | $results = $this->object->searchItems($search); |
71 | 71 | |
72 | - if( ( $item = reset($results) ) === false ) { |
|
73 | - throw new \RuntimeException( 'No type item found' ); |
|
72 | + if (($item = reset($results)) === false) { |
|
73 | + throw new \RuntimeException('No type item found'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $item->setId(null); |
77 | - $item->setCode( 'unitTestInit' ); |
|
78 | - $resultSaved = $this->object->saveItem( $item ); |
|
79 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
77 | + $item->setCode('unitTestInit'); |
|
78 | + $resultSaved = $this->object->saveItem($item); |
|
79 | + $itemSaved = $this->object->getItem($item->getId()); |
|
80 | 80 | |
81 | 81 | $itemExp = clone $itemSaved; |
82 | - $itemExp->setCode( 'unitTestSave' ); |
|
83 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
84 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
82 | + $itemExp->setCode('unitTestSave'); |
|
83 | + $resultUpd = $this->object->saveItem($itemExp); |
|
84 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
85 | 85 | |
86 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
86 | + $this->object->deleteItem($itemSaved->getId()); |
|
87 | 87 | |
88 | 88 | |
89 | - $this->assertTrue( $item->getId() !== null ); |
|
90 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
91 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
92 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
93 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
94 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
95 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
89 | + $this->assertTrue($item->getId() !== null); |
|
90 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
91 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
92 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
93 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
94 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
95 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
96 | 96 | |
97 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
98 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
99 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
97 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
98 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
99 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
100 | 100 | |
101 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
102 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
103 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
104 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
105 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
106 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
101 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
102 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
103 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
104 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
105 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
106 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
107 | 107 | |
108 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
109 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
110 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
108 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
109 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
110 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
111 | 111 | |
112 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
113 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
112 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
113 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
114 | 114 | |
115 | 115 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
116 | - $this->object->getItem( $itemSaved->getId() ); |
|
116 | + $this->object->getItem($itemSaved->getId()); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -123,26 +123,26 @@ discard block |
||
123 | 123 | $search = $this->object->createSearch(); |
124 | 124 | |
125 | 125 | $expr = []; |
126 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
127 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
128 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
129 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
130 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
131 | - $expr[] = $search->compare( '>=', 'customer.lists.type.position', 0 ); |
|
132 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
133 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
134 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
135 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
136 | - |
|
137 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
126 | + $expr[] = $search->compare('!=', 'customer.lists.type.id', 0); |
|
127 | + $expr[] = $search->compare('!=', 'customer.lists.type.siteid', null); |
|
128 | + $expr[] = $search->compare('==', 'customer.lists.type.code', 'default'); |
|
129 | + $expr[] = $search->compare('==', 'customer.lists.type.domain', 'text'); |
|
130 | + $expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard'); |
|
131 | + $expr[] = $search->compare('>=', 'customer.lists.type.position', 0); |
|
132 | + $expr[] = $search->compare('==', 'customer.lists.type.status', 1); |
|
133 | + $expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00'); |
|
134 | + $expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00'); |
|
135 | + $expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor); |
|
136 | + |
|
137 | + $search->setConditions($search->combine('&&', $expr)); |
|
138 | 138 | $search->setSlice(0, 1); |
139 | 139 | |
140 | - $results = $this->object->searchItems( $search, [], $total ); |
|
141 | - $this->assertEquals( 1, count( $results ) ); |
|
142 | - $this->assertEquals( 1, $total ); |
|
140 | + $results = $this->object->searchItems($search, [], $total); |
|
141 | + $this->assertEquals(1, count($results)); |
|
142 | + $this->assertEquals(1, $total); |
|
143 | 143 | |
144 | - foreach($results as $itemId => $item) { |
|
145 | - $this->assertEquals( $itemId, $item->getId() ); |
|
144 | + foreach ($results as $itemId => $item) { |
|
145 | + $this->assertEquals($itemId, $item->getId()); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 |