@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $search->setConditions( $search->compare( '==', 'attribute.property.editor', $this->editor ) ); |
62 | 62 | $results = $this->object->searchItems( $search ); |
63 | 63 | |
64 | - if( ( $item = reset($results) ) === false ) { |
|
64 | + if( ( $item = reset( $results ) ) === false ) { |
|
65 | 65 | throw new \RuntimeException( 'No property item found' ); |
66 | 66 | } |
67 | 67 | |
68 | - $item->setId(null); |
|
68 | + $item->setId( null ); |
|
69 | 69 | $item->setLanguageId( 'en' ); |
70 | 70 | $resultSaved = $this->object->saveItem( $item ); |
71 | 71 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | { |
117 | 117 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
118 | 118 | $conditions = array( |
119 | - $search->compare( '~=', 'attribute.property.value', '1024'), |
|
119 | + $search->compare( '~=', 'attribute.property.value', '1024' ), |
|
120 | 120 | $search->compare( '==', 'attribute.property.editor', $this->editor ) |
121 | 121 | ); |
122 | 122 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
123 | 123 | $results = $this->object->searchItems( $search ); |
124 | 124 | |
125 | - if( ($expected = reset($results)) === false ) { |
|
125 | + if( ( $expected = reset( $results ) ) === false ) { |
|
126 | 126 | throw new \RuntimeException( sprintf( 'No attribute property item found for value "%1$s".', '1024' ) ); |
127 | 127 | } |
128 | 128 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $expr[] = $search->compare( '==', 'attribute.property.value', '1024' ); |
162 | 162 | $expr[] = $search->compare( '==', 'attribute.property.editor', $this->editor ); |
163 | 163 | |
164 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
164 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
165 | 165 | $results = $this->object->searchItems( $search, [], $total ); |
166 | 166 | $this->assertEquals( 1, count( $results ) ); |
167 | 167 | } |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | |
170 | 170 | public function testGetSubManager() |
171 | 171 | { |
172 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
173 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
172 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
173 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
174 | 174 | |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('unknown'); |
|
176 | + $this->object->getSubManager( 'unknown' ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
180 | 180 | public function testGetSubManagerInvalidName() |
181 | 181 | { |
182 | 182 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
183 | - $this->object->getSubManager('type', 'unknown'); |
|
183 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
184 | 184 | } |
185 | 185 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) ); |
55 | 55 | $results = $this->object->searchItems( $search ); |
56 | 56 | |
57 | - if( ( $item = reset($results) ) === false ) { |
|
57 | + if( ( $item = reset( $results ) ) === false ) { |
|
58 | 58 | throw new \RuntimeException( 'No property item found' ); |
59 | 59 | } |
60 | 60 | |
61 | - $item->setId(null); |
|
61 | + $item->setId( null ); |
|
62 | 62 | $item->setLanguageId( 'en' ); |
63 | 63 | $resultSaved = $this->object->saveItem( $item ); |
64 | 64 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | { |
110 | 110 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
111 | 111 | $conditions = array( |
112 | - $search->compare( '~=', 'customer.property.value', '1'), |
|
112 | + $search->compare( '~=', 'customer.property.value', '1' ), |
|
113 | 113 | $search->compare( '==', 'customer.property.editor', $this->editor ) |
114 | 114 | ); |
115 | 115 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
116 | 116 | $results = $this->object->searchItems( $search ); |
117 | 117 | |
118 | - if( ($expected = reset($results)) === false ) { |
|
118 | + if( ( $expected = reset( $results ) ) === false ) { |
|
119 | 119 | throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) ); |
120 | 120 | } |
121 | 121 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $expr[] = $search->compare( '==', 'customer.property.value', '1' ); |
155 | 155 | $expr[] = $search->compare( '==', 'customer.property.editor', $this->editor ); |
156 | 156 | |
157 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
157 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
158 | 158 | $results = $this->object->searchItems( $search, [], $total ); |
159 | 159 | $this->assertEquals( 1, count( $results ) ); |
160 | 160 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | |
163 | 163 | public function testGetSubManager() |
164 | 164 | { |
165 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
166 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
165 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
166 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
167 | 167 | |
168 | 168 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
169 | - $this->object->getSubManager('unknown'); |
|
169 | + $this->object->getSubManager( 'unknown' ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetSubManagerInvalidName() |
174 | 174 | { |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('type', 'unknown'); |
|
176 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
177 | 177 | } |
178 | 178 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $search->setConditions( $search->compare( '==', 'product.property.editor', $this->editor ) ); |
55 | 55 | $results = $this->object->searchItems( $search ); |
56 | 56 | |
57 | - if( ( $item = reset($results) ) === false ) { |
|
57 | + if( ( $item = reset( $results ) ) === false ) { |
|
58 | 58 | throw new \RuntimeException( 'No property item found' ); |
59 | 59 | } |
60 | 60 | |
61 | - $item->setId(null); |
|
61 | + $item->setId( null ); |
|
62 | 62 | $item->setLanguageId( 'en' ); |
63 | 63 | $resultSaved = $this->object->saveItem( $item ); |
64 | 64 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | { |
110 | 110 | $search = $this->object->createSearch()->setSlice( 0, 1 ); |
111 | 111 | $conditions = array( |
112 | - $search->compare( '~=', 'product.property.value', '25.0'), |
|
112 | + $search->compare( '~=', 'product.property.value', '25.0' ), |
|
113 | 113 | $search->compare( '==', 'product.property.editor', $this->editor ) |
114 | 114 | ); |
115 | 115 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
116 | 116 | $results = $this->object->searchItems( $search ); |
117 | 117 | |
118 | - if( ($expected = reset($results)) === false ) { |
|
118 | + if( ( $expected = reset( $results ) ) === false ) { |
|
119 | 119 | throw new \RuntimeException( sprintf( 'No product property item found for value "%1$s".', '25.0' ) ); |
120 | 120 | } |
121 | 121 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $expr[] = $search->compare( '==', 'product.property.value', '25.00' ); |
155 | 155 | $expr[] = $search->compare( '==', 'product.property.editor', $this->editor ); |
156 | 156 | |
157 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
157 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
158 | 158 | $results = $this->object->searchItems( $search, [], $total ); |
159 | 159 | $this->assertEquals( 1, count( $results ) ); |
160 | 160 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | |
163 | 163 | public function testGetSubManager() |
164 | 164 | { |
165 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') ); |
|
166 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') ); |
|
165 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) ); |
|
166 | + $this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) ); |
|
167 | 167 | |
168 | 168 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
169 | - $this->object->getSubManager('unknown'); |
|
169 | + $this->object->getSubManager( 'unknown' ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetSubManagerInvalidName() |
174 | 174 | { |
175 | 175 | $this->setExpectedException( \Aimeos\MShop\Exception::class ); |
176 | - $this->object->getSubManager('type', 'unknown'); |
|
176 | + $this->object->getSubManager( 'type', 'unknown' ); |
|
177 | 177 | } |
178 | 178 | } |
@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | $search->compare( '==', $prefix . '.lists.domain', $key ), |
101 | 101 | $search->compare( '==', $prefix . '.lists.type', $domain ), |
102 | 102 | ] ); |
103 | - } |
|
104 | - else |
|
103 | + } else |
|
105 | 104 | { |
106 | 105 | $list[] = $search->compare( '==', $prefix . '.lists.domain', $domain ); |
107 | 106 | } |
@@ -109,8 +108,7 @@ discard block |
||
109 | 108 | |
110 | 109 | $expr[] = $search->combine( '||', $list ); |
111 | 110 | $search->setConditions( $search->combine( '&&', $expr ) ); |
112 | - } |
|
113 | - else |
|
111 | + } else |
|
114 | 112 | { |
115 | 113 | $search->setConditions( $search->compare( '==', $prefix . '.lists.parentid', $ids ) ); |
116 | 114 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | foreach( $testdata['media/property'] as $key => $dataset ) |
92 | 92 | { |
93 | 93 | $prodProperty->setId( null ); |
94 | - $prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] ); |
|
94 | + $prodProperty->setParentId( $prodIds[$dataset['parentid']] ); |
|
95 | 95 | $prodProperty->setLanguageId( $dataset['langid'] ); |
96 | 96 | $prodProperty->setValue( $dataset['value'] ); |
97 | 97 | $prodProperty->setType( $dataset['type'] ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $search = $mediaManager->createSearch(); |
116 | 116 | |
117 | 117 | foreach( $mediaManager->searchItems( $search ) as $id => $item ) { |
118 | - $entry[ 'media/' . $item->getUrl() ] = $id; |
|
118 | + $entry['media/' . $item->getUrl()] = $id; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return $entry; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | foreach( $testdata['attribute/property'] as $key => $dataset ) |
93 | 93 | { |
94 | 94 | $prodProperty->setId( null ); |
95 | - $prodProperty->setParentId( $prodIds[ $dataset['parentid'] ] ); |
|
95 | + $prodProperty->setParentId( $prodIds[$dataset['parentid']] ); |
|
96 | 96 | $prodProperty->setLanguageId( $dataset['langid'] ); |
97 | 97 | $prodProperty->setValue( $dataset['value'] ); |
98 | 98 | $prodProperty->setType( $dataset['type'] ); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $search = $attributeManager->createSearch(); |
117 | 117 | |
118 | 118 | foreach( $attributeManager->searchItems( $search ) as $id => $item ) { |
119 | - $entry[ 'attribute/' . $item->getDomain() . '/' . $item->getType() . '/' . $item->getCode() ] = $id; |
|
119 | + $entry['attribute/' . $item->getDomain() . '/' . $item->getType() . '/' . $item->getCode()] = $id; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $entry; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | $ds = DIRECTORY_SEPARATOR; |
50 | 50 | $path = __DIR__ . $ds . 'data' . $ds . 'supplier-list.php'; |
51 | 51 | |
52 | - if( ( $testdata = include( $path ) ) == false ){ |
|
52 | + if( ( $testdata = include( $path ) ) == false ) { |
|
53 | 53 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for supplier list domain', $path ) ); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $refKeys = []; |
57 | 57 | foreach( $testdata['supplier/lists'] as $dataset ) { |
58 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
58 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $refIds = []; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $codes = []; |
119 | 119 | foreach( $keys as $dataset ) |
120 | 120 | { |
121 | - if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) { |
|
121 | + if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) { |
|
122 | 122 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref products are set wrong "%1$s"', $dataset ) ); |
123 | 123 | } |
124 | 124 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $refIds = []; |
132 | 132 | foreach( $manager->searchItems( $search ) as $item ) { |
133 | - $refIds[ 'product/' . $item->getCode() ] = $item->getId(); |
|
133 | + $refIds['product/' . $item->getCode()] = $item->getId(); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return $refIds; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $labels = []; |
151 | 151 | foreach( $keys as $dataset ) |
152 | 152 | { |
153 | - if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos+1 ) ) === false ) { |
|
153 | + if( ( $pos = strpos( $dataset, '/' ) ) === false || ( $str = substr( $dataset, $pos + 1 ) ) === false ) { |
|
154 | 154 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for ref text are set wrong "%1$s"', $dataset ) ); |
155 | 155 | } |
156 | 156 | |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $search->setConditions( $search->compare( '==', 'text.label', $labels ) ); |
162 | 162 | |
163 | 163 | $refIds = []; |
164 | - foreach( $textManager->searchItems( $search ) as $item ) { |
|
165 | - $refIds[ 'text/'.$item->getLabel() ] = $item->getId(); |
|
164 | + foreach( $textManager->searchItems( $search ) as $item ) { |
|
165 | + $refIds['text/' . $item->getLabel()] = $item->getId(); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $refIds; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $itemCode = []; |
187 | 187 | foreach( $testdata['supplier/lists'] as $dataset ) |
188 | 188 | { |
189 | - if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos+1 ) ) === false ) { |
|
189 | + if( ( $pos = strpos( $dataset['parentid'], '/' ) ) === false || ( $str = substr( $dataset['parentid'], $pos + 1 ) ) === false ) { |
|
190 | 190 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'Some keys for parentid are set wrong "%1$s"', $dataset['parentid'] ) ); |
191 | 191 | } |
192 | 192 | |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | $search = $supplierManager->createSearch(); |
197 | - $search->setConditions( $search->compare( '==', 'supplier.code', $itemCode) ); |
|
197 | + $search->setConditions( $search->compare( '==', 'supplier.code', $itemCode ) ); |
|
198 | 198 | |
199 | 199 | $parentIds = []; |
200 | - foreach( $supplierManager->searchItems( $search ) as $item ) { |
|
201 | - $parentIds[ 'supplier/'.$item->getCode() ] = $item->getId(); |
|
200 | + foreach( $supplierManager->searchItems( $search ) as $item ) { |
|
201 | + $parentIds['supplier/' . $item->getCode()] = $item->getId(); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $listItemType = $supplierListTypeManager->createItem(); |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | $listItem = $supplierListManager->createItem(); |
220 | 220 | foreach( $testdata['supplier/lists'] as $dataset ) |
221 | 221 | { |
222 | - if( !isset( $parentIds[ $dataset['parentid'] ] ) ) { |
|
222 | + if( !isset( $parentIds[$dataset['parentid']] ) ) { |
|
223 | 223 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No supplier ID found for "%1$s"', $dataset['parentid'] ) ); |
224 | 224 | } |
225 | 225 | |
226 | - if( !isset( $refIds[ $dataset['domain'] ][ $dataset['refid'] ] ) ) { |
|
226 | + if( !isset( $refIds[$dataset['domain']][$dataset['refid']] ) ) { |
|
227 | 227 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No "%2$s" ref ID found for "%1$s"', $dataset['refid'], $dataset['domain'] ) ); |
228 | 228 | } |
229 | 229 | |
230 | 230 | $listItem->setId( null ); |
231 | - $listItem->setParentId( $parentIds[ $dataset['parentid'] ] ); |
|
232 | - $listItem->setRefId( $refIds[ $dataset['domain'] ] [ $dataset['refid'] ] ); |
|
231 | + $listItem->setParentId( $parentIds[$dataset['parentid']] ); |
|
232 | + $listItem->setRefId( $refIds[$dataset['domain']] [$dataset['refid']] ); |
|
233 | 233 | $listItem->setType( $dataset['type'] ); |
234 | 234 | $listItem->setDomain( $dataset['domain'] ); |
235 | 235 | $listItem->setDateStart( $dataset['start'] ); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2015-2018 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'supplier/lists/type' => array ( |
|
8 | +return array( |
|
9 | + 'supplier/lists/type' => array( |
|
10 | 10 | 'attribute/default' => array( 'domain' => 'attribute', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
11 | 11 | 'media/default' => array( 'domain' => 'media', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
12 | 12 | 'product/default' => array( 'domain' => 'product', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
13 | 13 | 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
14 | 14 | ), |
15 | 15 | |
16 | - 'supplier/lists' => array ( |
|
16 | + 'supplier/lists' => array( |
|
17 | 17 | array( 'parentid' => 'supplier/unitCode001', 'type' => 'default', 'domain' => 'product', 'refid' => 'product/CNC', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
18 | 18 | array( 'parentid' => 'supplier/unitCode001', 'type' => 'default', 'domain' => 'product', 'refid' => 'product/CNE', 'start' => '2010-01-01 00:00:00', 'end' => null, 'config' => [], 'pos' => 2, 'status' => 1 ), |
19 | 19 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'mshop_tag_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'mshop_tag_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'mshop_tag_type' ); |
14 | 14 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return $schema; |
33 | 33 | }, |
34 | 34 | |
35 | - 'mshop_tag' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
35 | + 'mshop_tag' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
36 | 36 | |
37 | 37 | $table = $schema->createTable( 'mshop_tag' ); |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
45 | 45 | $table->addColumn( 'mtime', 'datetime', [] ); |
46 | 46 | $table->addColumn( 'ctime', 'datetime', [] ); |
47 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
47 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
48 | 48 | |
49 | 49 | $table->setPrimaryKey( array( 'id' ), 'pk_mstag_id' ); |
50 | 50 | $table->addUniqueIndex( array( 'siteid', 'domain', 'type', 'langid', 'label' ), 'unq_mstag_sid_dom_ty_lid_lab' ); |