@@ -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 |
@@ -21,41 +21,41 @@ discard block |
||
21 | 21 | { |
22 | 22 | $context = \TestHelper::getContext(); |
23 | 23 | $this->editor = $context->getEditor(); |
24 | - $this->object = new \Aimeos\MShop\Customer\Manager\Laravel( $context ); |
|
24 | + $this->object = new \Aimeos\MShop\Customer\Manager\Laravel($context); |
|
25 | 25 | |
26 | 26 | $this->fixture = array( |
27 | 27 | 'label' => 'unitTest', |
28 | 28 | 'status' => 2, |
29 | 29 | ); |
30 | 30 | |
31 | - $this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' ); |
|
31 | + $this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | protected function tearDown() |
36 | 36 | { |
37 | - unset( $this->object, $this->fixture, $this->address ); |
|
37 | + unset($this->object, $this->fixture, $this->address); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testCleanup() |
42 | 42 | { |
43 | - $this->object->cleanup( array( -1 ) ); |
|
43 | + $this->object->cleanup(array( -1 )); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testGetSearchAttributes() |
48 | 48 | { |
49 | - foreach( $this->object->getSearchAttributes() as $attribute ) |
|
49 | + foreach ($this->object->getSearchAttributes() as $attribute) |
|
50 | 50 | { |
51 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
51 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testCreateItem() |
57 | 57 | { |
58 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() ); |
|
58 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -63,21 +63,21 @@ discard block |
||
63 | 63 | { |
64 | 64 | $search = $this->object->createSearch(); |
65 | 65 | $conditions = array( |
66 | - $search->compare( '==', 'customer.code', 'UTC003' ), |
|
67 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
66 | + $search->compare('==', 'customer.code', 'UTC003'), |
|
67 | + $search->compare('==', 'customer.editor', $this->editor) |
|
68 | 68 | ); |
69 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
70 | - $items = $this->object->searchItems( $search, array( 'text' ) ); |
|
69 | + $search->setConditions($search->combine('&&', $conditions)); |
|
70 | + $items = $this->object->searchItems($search, array('text')); |
|
71 | 71 | |
72 | - if( ( $expected = reset( $items ) ) === false ) { |
|
73 | - throw new \RuntimeException( 'No customer item with code "UTC003" found' ); |
|
72 | + if (($expected = reset($items)) === false) { |
|
73 | + throw new \RuntimeException('No customer item with code "UTC003" found'); |
|
74 | 74 | } |
75 | 75 | |
76 | - $actual = $this->object->getItem( $expected->getId(), array( 'text' ) ); |
|
76 | + $actual = $this->object->getItem($expected->getId(), array('text')); |
|
77 | 77 | |
78 | - $this->assertEquals( $expected, $actual ); |
|
79 | - $this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) ); |
|
80 | - $this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) ); |
|
78 | + $this->assertEquals($expected, $actual); |
|
79 | + $this->assertEquals(3, count($actual->getListItems('text'))); |
|
80 | + $this->assertEquals(3, count($actual->getRefItems('text'))); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -85,92 +85,92 @@ discard block |
||
85 | 85 | { |
86 | 86 | $item = $this->object->createItem(); |
87 | 87 | |
88 | - $item->setCode( 'unitTest' ); |
|
89 | - $item->setLabel( 'unitTest' ); |
|
90 | - $resultSaved = $this->object->saveItem( $item ); |
|
91 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
88 | + $item->setCode('unitTest'); |
|
89 | + $item->setLabel('unitTest'); |
|
90 | + $resultSaved = $this->object->saveItem($item); |
|
91 | + $itemSaved = $this->object->getItem($item->getId()); |
|
92 | 92 | |
93 | 93 | $itemExp = clone $itemSaved; |
94 | - $itemExp->setCode( 'unitTest2' ); |
|
95 | - $itemExp->setLabel( 'unitTest2' ); |
|
96 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
97 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
98 | - |
|
99 | - $this->object->deleteItem( $item->getId() ); |
|
100 | - |
|
101 | - $this->assertTrue( $item->getId() !== null ); |
|
102 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
103 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
104 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
105 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
106 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
107 | - $this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() ); |
|
108 | - $this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() ); |
|
109 | - $this->assertEquals( $item->getPassword(), $itemSaved->getPassword() ); |
|
110 | - |
|
111 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
112 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
113 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
114 | - |
|
115 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
116 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
117 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
118 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
119 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
120 | - $this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() ); |
|
121 | - $this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() ); |
|
122 | - $this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() ); |
|
123 | - |
|
124 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
125 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
126 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
127 | - |
|
128 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
129 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
130 | - |
|
131 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
132 | - $this->object->getItem( $item->getId() ); |
|
94 | + $itemExp->setCode('unitTest2'); |
|
95 | + $itemExp->setLabel('unitTest2'); |
|
96 | + $resultUpd = $this->object->saveItem($itemExp); |
|
97 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
98 | + |
|
99 | + $this->object->deleteItem($item->getId()); |
|
100 | + |
|
101 | + $this->assertTrue($item->getId() !== null); |
|
102 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
103 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
104 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
105 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
106 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
107 | + $this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress()); |
|
108 | + $this->assertEquals($item->getBirthday(), $itemSaved->getBirthday()); |
|
109 | + $this->assertEquals($item->getPassword(), $itemSaved->getPassword()); |
|
110 | + |
|
111 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
112 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
113 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
114 | + |
|
115 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
116 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
117 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
118 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
119 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
120 | + $this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress()); |
|
121 | + $this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday()); |
|
122 | + $this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword()); |
|
123 | + |
|
124 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
125 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
126 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
127 | + |
|
128 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
129 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
130 | + |
|
131 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
132 | + $this->object->getItem($item->getId()); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
136 | 136 | public function testGetSaveAddressItems() |
137 | 137 | { |
138 | - $item = $this->object->findItem( 'UTC001', ['customer/address'] ); |
|
138 | + $item = $this->object->findItem('UTC001', ['customer/address']); |
|
139 | 139 | |
140 | - $item->setId( null )->setCode( 'xyz' ); |
|
141 | - $item->getPaymentAddress()->setEmail( '[email protected]' ); |
|
142 | - $item->addAddressItem( new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.' ) ); |
|
143 | - $this->object->saveItem( $item ); |
|
140 | + $item->setId(null)->setCode('xyz'); |
|
141 | + $item->getPaymentAddress()->setEmail('[email protected]'); |
|
142 | + $item->addAddressItem(new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.')); |
|
143 | + $this->object->saveItem($item); |
|
144 | 144 | |
145 | - $item2 = $this->object->findItem( 'xyz', ['customer/address'] ); |
|
145 | + $item2 = $this->object->findItem('xyz', ['customer/address']); |
|
146 | 146 | |
147 | - $this->object->deleteItem( $item->getId() ); |
|
147 | + $this->object->deleteItem($item->getId()); |
|
148 | 148 | |
149 | - $this->assertEquals( 2, count( $item->getAddressItems() ) ); |
|
150 | - $this->assertEquals( 2, count( $item2->getAddressItems() ) ); |
|
149 | + $this->assertEquals(2, count($item->getAddressItems())); |
|
150 | + $this->assertEquals(2, count($item2->getAddressItems())); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testGetSavePropertyItems() |
155 | 155 | { |
156 | - $item = $this->object->findItem( 'UTC001', ['customer/property'] ); |
|
156 | + $item = $this->object->findItem('UTC001', ['customer/property']); |
|
157 | 157 | |
158 | - $item->setId( null )->setCode( 'xyz' ); |
|
159 | - $item->getPaymentAddress()->setEmail( '[email protected]' ); |
|
160 | - $this->object->saveItem( $item ); |
|
158 | + $item->setId(null)->setCode('xyz'); |
|
159 | + $item->getPaymentAddress()->setEmail('[email protected]'); |
|
160 | + $this->object->saveItem($item); |
|
161 | 161 | |
162 | - $item2 = $this->object->findItem( 'xyz', ['customer/property'] ); |
|
162 | + $item2 = $this->object->findItem('xyz', ['customer/property']); |
|
163 | 163 | |
164 | - $this->object->deleteItem( $item->getId() ); |
|
164 | + $this->object->deleteItem($item->getId()); |
|
165 | 165 | |
166 | - $this->assertEquals( 1, count( $item->getPropertyItems() ) ); |
|
167 | - $this->assertEquals( 1, count( $item2->getPropertyItems() ) ); |
|
166 | + $this->assertEquals(1, count($item->getPropertyItems())); |
|
167 | + $this->assertEquals(1, count($item2->getPropertyItems())); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
171 | 171 | public function testCreateSearch() |
172 | 172 | { |
173 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
173 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -180,69 +180,69 @@ discard block |
||
180 | 180 | $search = $this->object->createSearch(); |
181 | 181 | |
182 | 182 | $expr = []; |
183 | - $expr[] = $search->compare( '!=', 'customer.id', null ); |
|
184 | - $expr[] = $search->compare( '==', 'customer.label', 'unitCustomer2' ); |
|
185 | - $expr[] = $search->compare( '==', 'customer.code', 'UTC002' ); |
|
186 | - |
|
187 | - $expr[] = $search->compare( '>=', 'customer.salutation', '' ); |
|
188 | - $expr[] = $search->compare( '>=', 'customer.company', '' ); |
|
189 | - $expr[] = $search->compare( '>=', 'customer.vatid', '' ); |
|
190 | - $expr[] = $search->compare( '>=', 'customer.title', '' ); |
|
191 | - $expr[] = $search->compare( '>=', 'customer.firstname', '' ); |
|
192 | - $expr[] = $search->compare( '>=', 'customer.lastname', '' ); |
|
193 | - $expr[] = $search->compare( '>=', 'customer.address1', '' ); |
|
194 | - $expr[] = $search->compare( '>=', 'customer.address2', '' ); |
|
195 | - $expr[] = $search->compare( '>=', 'customer.address3', '' ); |
|
196 | - $expr[] = $search->compare( '>=', 'customer.postal', '' ); |
|
197 | - $expr[] = $search->compare( '>=', 'customer.city', '' ); |
|
198 | - $expr[] = $search->compare( '>=', 'customer.state', '' ); |
|
199 | - $expr[] = $search->compare( '!=', 'customer.languageid', null ); |
|
200 | - $expr[] = $search->compare( '>=', 'customer.countryid', '' ); |
|
201 | - $expr[] = $search->compare( '>=', 'customer.telephone', '' ); |
|
202 | - $expr[] = $search->compare( '>=', 'customer.email', '' ); |
|
203 | - $expr[] = $search->compare( '>=', 'customer.telefax', '' ); |
|
204 | - $expr[] = $search->compare( '>=', 'customer.website', '' ); |
|
205 | - $expr[] = $search->compare( '>=', 'customer.longitude', '10.0' ); |
|
206 | - $expr[] = $search->compare( '>=', 'customer.latitude', '50.0' ); |
|
207 | - |
|
208 | - $expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' ); |
|
209 | - $expr[] = $search->compare( '>=', 'customer.password', '' ); |
|
210 | - $expr[] = $search->compare( '==', 'customer.status', 0 ); |
|
211 | - $expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' ); |
|
212 | - $expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' ); |
|
213 | - $expr[] = $search->compare( '==', 'customer.editor', $this->editor ); |
|
214 | - |
|
215 | - $expr[] = $search->compare( '!=', 'customer.address.id', null ); |
|
216 | - $expr[] = $search->compare( '!=', 'customer.address.parentid', null ); |
|
217 | - $expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' ); |
|
218 | - $expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' ); |
|
219 | - $expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' ); |
|
220 | - $expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' ); |
|
221 | - $expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' ); |
|
222 | - $expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' ); |
|
223 | - $expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' ); |
|
224 | - $expr[] = $search->compare( '==', 'customer.address.address2', '2-4' ); |
|
225 | - $expr[] = $search->compare( '==', 'customer.address.address3', '' ); |
|
226 | - $expr[] = $search->compare( '==', 'customer.address.postal', '11099' ); |
|
227 | - $expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' ); |
|
228 | - $expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' ); |
|
229 | - $expr[] = $search->compare( '==', 'customer.address.languageid', 'de' ); |
|
230 | - $expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' ); |
|
231 | - $expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' ); |
|
232 | - $expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' ); |
|
233 | - $expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' ); |
|
234 | - $expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' ); |
|
235 | - $expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' ); |
|
236 | - $expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' ); |
|
237 | - $expr[] = $search->compare( '==', 'customer.address.flag', 0 ); |
|
238 | - $expr[] = $search->compare( '==', 'customer.address.position', 1 ); |
|
239 | - $expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' ); |
|
240 | - $expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' ); |
|
241 | - $expr[] = $search->compare( '==', 'customer.address.editor', $this->editor ); |
|
242 | - |
|
243 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
244 | - $result = $this->object->searchItems( $search, [], $total ); |
|
245 | - $this->assertEquals( 1, count( $result ) ); |
|
183 | + $expr[] = $search->compare('!=', 'customer.id', null); |
|
184 | + $expr[] = $search->compare('==', 'customer.label', 'unitCustomer2'); |
|
185 | + $expr[] = $search->compare('==', 'customer.code', 'UTC002'); |
|
186 | + |
|
187 | + $expr[] = $search->compare('>=', 'customer.salutation', ''); |
|
188 | + $expr[] = $search->compare('>=', 'customer.company', ''); |
|
189 | + $expr[] = $search->compare('>=', 'customer.vatid', ''); |
|
190 | + $expr[] = $search->compare('>=', 'customer.title', ''); |
|
191 | + $expr[] = $search->compare('>=', 'customer.firstname', ''); |
|
192 | + $expr[] = $search->compare('>=', 'customer.lastname', ''); |
|
193 | + $expr[] = $search->compare('>=', 'customer.address1', ''); |
|
194 | + $expr[] = $search->compare('>=', 'customer.address2', ''); |
|
195 | + $expr[] = $search->compare('>=', 'customer.address3', ''); |
|
196 | + $expr[] = $search->compare('>=', 'customer.postal', ''); |
|
197 | + $expr[] = $search->compare('>=', 'customer.city', ''); |
|
198 | + $expr[] = $search->compare('>=', 'customer.state', ''); |
|
199 | + $expr[] = $search->compare('!=', 'customer.languageid', null); |
|
200 | + $expr[] = $search->compare('>=', 'customer.countryid', ''); |
|
201 | + $expr[] = $search->compare('>=', 'customer.telephone', ''); |
|
202 | + $expr[] = $search->compare('>=', 'customer.email', ''); |
|
203 | + $expr[] = $search->compare('>=', 'customer.telefax', ''); |
|
204 | + $expr[] = $search->compare('>=', 'customer.website', ''); |
|
205 | + $expr[] = $search->compare('>=', 'customer.longitude', '10.0'); |
|
206 | + $expr[] = $search->compare('>=', 'customer.latitude', '50.0'); |
|
207 | + |
|
208 | + $expr[] = $search->compare('==', 'customer.birthday', '1970-01-01'); |
|
209 | + $expr[] = $search->compare('>=', 'customer.password', ''); |
|
210 | + $expr[] = $search->compare('==', 'customer.status', 0); |
|
211 | + $expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00'); |
|
212 | + $expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00'); |
|
213 | + $expr[] = $search->compare('==', 'customer.editor', $this->editor); |
|
214 | + |
|
215 | + $expr[] = $search->compare('!=', 'customer.address.id', null); |
|
216 | + $expr[] = $search->compare('!=', 'customer.address.parentid', null); |
|
217 | + $expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH'); |
|
218 | + $expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999'); |
|
219 | + $expr[] = $search->compare('==', 'customer.address.salutation', 'mr'); |
|
220 | + $expr[] = $search->compare('==', 'customer.address.title', 'Dr.'); |
|
221 | + $expr[] = $search->compare('==', 'customer.address.firstname', 'Good'); |
|
222 | + $expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest'); |
|
223 | + $expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben'); |
|
224 | + $expr[] = $search->compare('==', 'customer.address.address2', '2-4'); |
|
225 | + $expr[] = $search->compare('==', 'customer.address.address3', ''); |
|
226 | + $expr[] = $search->compare('==', 'customer.address.postal', '11099'); |
|
227 | + $expr[] = $search->compare('==', 'customer.address.city', 'Berlin'); |
|
228 | + $expr[] = $search->compare('==', 'customer.address.state', 'Berlin'); |
|
229 | + $expr[] = $search->compare('==', 'customer.address.languageid', 'de'); |
|
230 | + $expr[] = $search->compare('==', 'customer.address.countryid', 'DE'); |
|
231 | + $expr[] = $search->compare('==', 'customer.address.telephone', '055544332221'); |
|
232 | + $expr[] = $search->compare('==', 'customer.address.email', '[email protected]'); |
|
233 | + $expr[] = $search->compare('==', 'customer.address.telefax', '055544333212'); |
|
234 | + $expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org'); |
|
235 | + $expr[] = $search->compare('>=', 'customer.address.longitude', '10.0'); |
|
236 | + $expr[] = $search->compare('>=', 'customer.address.latitude', '50.0'); |
|
237 | + $expr[] = $search->compare('==', 'customer.address.flag', 0); |
|
238 | + $expr[] = $search->compare('==', 'customer.address.position', 1); |
|
239 | + $expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00'); |
|
240 | + $expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00'); |
|
241 | + $expr[] = $search->compare('==', 'customer.address.editor', $this->editor); |
|
242 | + |
|
243 | + $search->setConditions($search->combine('&&', $expr)); |
|
244 | + $result = $this->object->searchItems($search, [], $total); |
|
245 | + $this->assertEquals(1, count($result)); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -251,60 +251,60 @@ discard block |
||
251 | 251 | $total = 0; |
252 | 252 | |
253 | 253 | $search = $this->object->createSearch(); |
254 | - $search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) ); |
|
255 | - $search->setSlice( 0, 2 ); |
|
254 | + $search->setConditions($search->compare('==', 'customer.address.editor', $this->editor)); |
|
255 | + $search->setSlice(0, 2); |
|
256 | 256 | |
257 | - $results = $this->object->searchItems( $search, [], $total ); |
|
258 | - $this->assertEquals( 2, count( $results ) ); |
|
259 | - $this->assertEquals( 3, $total ); |
|
257 | + $results = $this->object->searchItems($search, [], $total); |
|
258 | + $this->assertEquals(2, count($results)); |
|
259 | + $this->assertEquals(3, $total); |
|
260 | 260 | |
261 | - foreach($results as $itemId => $item) { |
|
262 | - $this->assertEquals( $itemId, $item->getId() ); |
|
261 | + foreach ($results as $itemId => $item) { |
|
262 | + $this->assertEquals($itemId, $item->getId()); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
266 | 266 | |
267 | 267 | public function testSearchItemsCriteria() |
268 | 268 | { |
269 | - $search = $this->object->createSearch( true ); |
|
269 | + $search = $this->object->createSearch(true); |
|
270 | 270 | $conditions = array( |
271 | - $search->compare( '==', 'customer.address.editor', $this->editor ), |
|
271 | + $search->compare('==', 'customer.address.editor', $this->editor), |
|
272 | 272 | $search->getConditions() |
273 | 273 | ); |
274 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
275 | - $this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) ); |
|
274 | + $search->setConditions($search->combine('&&', $conditions)); |
|
275 | + $this->assertEquals(2, count($this->object->searchItems($search, [], $total))); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | |
279 | 279 | public function testSearchItemsRef() |
280 | 280 | { |
281 | 281 | $search = $this->object->createSearch(); |
282 | - $search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) ); |
|
282 | + $search->setConditions($search->compare('==', 'customer.code', 'UTC001')); |
|
283 | 283 | |
284 | - $results = $this->object->searchItems( $search, ['customer/address', 'text'] ); |
|
284 | + $results = $this->object->searchItems($search, ['customer/address', 'text']); |
|
285 | 285 | |
286 | - if( ( $item = reset( $results ) ) === false ) { |
|
287 | - throw new \Exception( 'No customer item for "UTC001" available' ); |
|
286 | + if (($item = reset($results)) === false) { |
|
287 | + throw new \Exception('No customer item for "UTC001" available'); |
|
288 | 288 | } |
289 | 289 | |
290 | - $this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) ); |
|
291 | - $this->assertEquals( 1, count( $item->getAddressItems() ) ); |
|
290 | + $this->assertEquals(1, count($item->getRefItems('text'))); |
|
291 | + $this->assertEquals(1, count($item->getAddressItems())); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | |
295 | 295 | public function testGetSubManager() |
296 | 296 | { |
297 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) ); |
|
298 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) ); |
|
297 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address')); |
|
298 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard')); |
|
299 | 299 | |
300 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
301 | - $this->object->getSubManager( 'unknown' ); |
|
300 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
301 | + $this->object->getSubManager('unknown'); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
305 | 305 | public function testGetSubManagerInvalidName() |
306 | 306 | { |
307 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
308 | - $this->object->getSubManager( 'address', 'unknown' ); |
|
307 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
308 | + $this->object->getSubManager('address', 'unknown'); |
|
309 | 309 | } |
310 | 310 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getPostDependencies() |
40 | 40 | { |
41 | - return array( 'TablesCreateMShop' ); |
|
41 | + return array('TablesCreateMShop'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -47,29 +47,29 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function migrate() |
49 | 49 | { |
50 | - $this->msg( 'Remove left over Laravel user address records', 0 ); |
|
50 | + $this->msg('Remove left over Laravel user address records', 0); |
|
51 | 51 | |
52 | - if( $this->schema->tableExists( 'users' ) && $this->schema->tableExists( 'users_address' ) ) |
|
52 | + if ($this->schema->tableExists('users') && $this->schema->tableExists('users_address')) |
|
53 | 53 | { |
54 | - $this->execute( $this->sql['address'] ); |
|
55 | - $this->status( 'done' ); |
|
54 | + $this->execute($this->sql['address']); |
|
55 | + $this->status('done'); |
|
56 | 56 | } |
57 | 57 | else |
58 | 58 | { |
59 | - $this->status( 'OK' ); |
|
59 | + $this->status('OK'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | - $this->msg( 'Remove left over Laravel user list records', 0 ); |
|
63 | + $this->msg('Remove left over Laravel user list records', 0); |
|
64 | 64 | |
65 | - if( $this->schema->tableExists( 'users' ) && $this->schema->tableExists( 'users_list' ) ) |
|
65 | + if ($this->schema->tableExists('users') && $this->schema->tableExists('users_list')) |
|
66 | 66 | { |
67 | - $this->execute( $this->sql['list'] ); |
|
68 | - $this->status( 'done' ); |
|
67 | + $this->execute($this->sql['list']); |
|
68 | + $this->status('done'); |
|
69 | 69 | } |
70 | 70 | else |
71 | 71 | { |
72 | - $this->status( 'OK' ); |
|
72 | + $this->status('OK'); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'customer.property.id' => array( |
25 | 25 | 'code' => 'customer.property.id', |
26 | 26 | 'internalcode' => 'lvupr."id"', |
27 | - 'internaldeps'=>array( 'LEFT JOIN "users_property" AS lvupr ON ( lvupr."parentid" = fos."id" )' ), |
|
27 | + 'internaldeps'=>array('LEFT JOIN "users_property" AS lvupr ON ( lvupr."parentid" = fos."id" )'), |
|
28 | 28 | 'label' => 'Property ID', |
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @param integer[] $siteids List of IDs for sites whose entries should be deleted |
102 | 102 | */ |
103 | - public function cleanup( array $siteids ) |
|
103 | + public function cleanup(array $siteids) |
|
104 | 104 | { |
105 | 105 | $path = 'mshop/customer/manager/property/submanagers'; |
106 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
107 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
106 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
107 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
108 | 108 | } |
109 | 109 | |
110 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/property/laravel/delete' ); |
|
110 | + $this->cleanupBase($siteids, 'mshop/customer/manager/property/laravel/delete'); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | * @param boolean $withsub Return also attributes of sub-managers if true |
118 | 118 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
119 | 119 | */ |
120 | - public function getSearchAttributes( $withsub = true ) |
|
120 | + public function getSearchAttributes($withsub = true) |
|
121 | 121 | { |
122 | 122 | $path = 'mshop/customer/manager/property/submanagers'; |
123 | 123 | |
124 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, ['type'], $withsub ); |
|
124 | + return $this->getSearchAttributesBase($this->searchConfig, $path, ['type'], $withsub); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | * configuration (or Default) if null |
134 | 134 | * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g property types, property lists etc. |
135 | 135 | */ |
136 | - public function getSubManager( $manager, $name = null ) |
|
136 | + public function getSubManager($manager, $name = null) |
|
137 | 137 | { |
138 | - return $this->getSubManagerBase( 'customer', 'property/' . $manager, ( $name === null ? 'Laravel' : $name ) ); |
|
138 | + return $this->getSubManagerBase('customer', 'property/'.$manager, ($name === null ? 'Laravel' : $name)); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'customer.property.type.id' => array( |
25 | 25 | 'code' => 'customer.property.type.id', |
26 | 26 | 'internalcode' => 'lvuprty."id"', |
27 | - 'internaldeps' => array( 'LEFT JOIN "users_property_type" AS lvuprty ON ( lvupr."typeid" = lvuprty."id" )' ), |
|
27 | + 'internaldeps' => array('LEFT JOIN "users_property_type" AS lvuprty ON ( lvupr."typeid" = lvuprty."id" )'), |
|
28 | 28 | 'label' => 'Property type ID', |
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @param array $siteids List of IDs for sites whose entries should be deleted |
107 | 107 | */ |
108 | - public function cleanup( array $siteids ) |
|
108 | + public function cleanup(array $siteids) |
|
109 | 109 | { |
110 | 110 | $path = 'mshop/customer/manager/property/type/submanagers'; |
111 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
112 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
111 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
112 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
113 | 113 | } |
114 | 114 | |
115 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/property/type/laravel/delete' ); |
|
115 | + $this->cleanupBase($siteids, 'mshop/customer/manager/property/type/laravel/delete'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | * @param boolean $withsub Return also attributes of sub-managers if true |
123 | 123 | * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface |
124 | 124 | */ |
125 | - public function getSearchAttributes( $withsub = true ) |
|
125 | + public function getSearchAttributes($withsub = true) |
|
126 | 126 | { |
127 | 127 | $path = 'mshop/customer/manager/property/type/submanagers'; |
128 | 128 | |
129 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
129 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
138 | 138 | * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g types, lists etc. |
139 | 139 | */ |
140 | - public function getSubManager( $manager, $name = null ) |
|
140 | + public function getSubManager($manager, $name = null) |
|
141 | 141 | { |
142 | - return $this->getSubManagerBase( 'customer', 'property/type/' . $manager, ( $name === null ? 'Laravel' : $name ) ); |
|
142 | + return $this->getSubManagerBase('customer', 'property/type/'.$manager, ($name === null ? 'Laravel' : $name)); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'label' => 'Customer address ID', |
26 | 26 | 'code' => 'customer.address.id', |
27 | 27 | 'internalcode' => 'lvuad."id"', |
28 | - 'internaldeps' => array( 'LEFT JOIN "users_address" AS lvuad ON ( lvu."id" = lvuad."parentid" )' ), |
|
28 | + 'internaldeps' => array('LEFT JOIN "users_address" AS lvuad ON ( lvu."id" = lvuad."parentid" )'), |
|
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
31 | 31 | 'public' => false, |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @param array $siteids List of IDs for sites whose entries should be deleted |
224 | 224 | */ |
225 | - public function cleanup( array $siteids ) |
|
225 | + public function cleanup(array $siteids) |
|
226 | 226 | { |
227 | 227 | $path = 'mshop/customer/manager/address/submanagers'; |
228 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
229 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
228 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
229 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
230 | 230 | } |
231 | 231 | |
232 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/address/laravel/delete' ); |
|
232 | + $this->cleanupBase($siteids, 'mshop/customer/manager/address/laravel/delete'); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | * @param boolean $withsub Return also attributes of sub-managers if true |
240 | 240 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
241 | 241 | */ |
242 | - public function getSearchAttributes( $withsub = true ) |
|
242 | + public function getSearchAttributes($withsub = true) |
|
243 | 243 | { |
244 | 244 | $path = 'mshop/customer/manager/address/submanagers'; |
245 | 245 | |
246 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
246 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
@@ -254,9 +254,9 @@ discard block |
||
254 | 254 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
255 | 255 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
256 | 256 | */ |
257 | - public function getSubManager( $manager, $name = null ) |
|
257 | + public function getSubManager($manager, $name = null) |
|
258 | 258 | { |
259 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Laravel' : $name ) ); |
|
259 | + return $this->getSubManagerBase('customer', 'address/'.$manager, ($name === null ? 'Laravel' : $name)); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | * |
242 | 242 | * @param array $siteids List of IDs for sites whose entries should be deleted |
243 | 243 | */ |
244 | - public function cleanup( array $siteids ) |
|
244 | + public function cleanup(array $siteids) |
|
245 | 245 | { |
246 | 246 | $path = 'mshop/customer/manager/submanagers'; |
247 | 247 | $default = ['address', 'group', 'lists', 'property']; |
248 | 248 | |
249 | - foreach( $this->getContext()->getConfig()->get( $path, $default ) as $domain ) { |
|
250 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
249 | + foreach ($this->getContext()->getConfig()->get($path, $default) as $domain) { |
|
250 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @param array $ids List of IDs |
259 | 259 | */ |
260 | - public function deleteItems( array $ids ) |
|
260 | + public function deleteItems(array $ids) |
|
261 | 261 | { |
262 | 262 | $path = 'mshop/customer/manager/laravel/delete'; |
263 | - $this->deleteItemsBase( $ids, $path, false ); |
|
263 | + $this->deleteItemsBase($ids, $path, false); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | * @param boolean $withsub Return also attributes of sub-managers if true |
271 | 271 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
272 | 272 | */ |
273 | - public function getSearchAttributes( $withsub = true ) |
|
273 | + public function getSearchAttributes($withsub = true) |
|
274 | 274 | { |
275 | 275 | $path = 'mshop/customer/manager/submanagers'; |
276 | 276 | $default = ['address', 'group', 'lists', 'property']; |
277 | 277 | |
278 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, $default, $withsub ); |
|
278 | + return $this->getSearchAttributesBase($this->searchConfig, $path, $default, $withsub); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -286,32 +286,32 @@ discard block |
||
286 | 286 | * @param boolean $fetch True if the new ID should be returned in the item |
287 | 287 | * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
288 | 288 | */ |
289 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
289 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
290 | 290 | { |
291 | 291 | $iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface'; |
292 | - if( !( $item instanceof $iface ) ) { |
|
293 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
292 | + if (!($item instanceof $iface)) { |
|
293 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
294 | 294 | } |
295 | 295 | |
296 | - if( !$item->isModified() ) |
|
296 | + if (!$item->isModified()) |
|
297 | 297 | { |
298 | - $item = $this->savePropertyItems( $item, 'customer' ); |
|
299 | - $item = $this->saveAddressItems( $item, 'customer' ); |
|
300 | - return $this->saveListItems( $item, 'customer' ); |
|
298 | + $item = $this->savePropertyItems($item, 'customer'); |
|
299 | + $item = $this->saveAddressItems($item, 'customer'); |
|
300 | + return $this->saveListItems($item, 'customer'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $context = $this->getContext(); |
304 | 304 | $dbm = $context->getDatabaseManager(); |
305 | 305 | $dbname = $this->getResourceName(); |
306 | - $conn = $dbm->acquire( $dbname ); |
|
306 | + $conn = $dbm->acquire($dbname); |
|
307 | 307 | |
308 | 308 | try |
309 | 309 | { |
310 | 310 | $id = $item->getId(); |
311 | - $date = date( 'Y-m-d H:i:s' ); |
|
311 | + $date = date('Y-m-d H:i:s'); |
|
312 | 312 | $billingAddress = $item->getPaymentAddress(); |
313 | 313 | |
314 | - if( $id === null ) |
|
314 | + if ($id === null) |
|
315 | 315 | { |
316 | 316 | /** mshop/customer/manager/laravel/insert |
317 | 317 | * Inserts a new customer record into the database table |
@@ -375,48 +375,48 @@ discard block |
||
375 | 375 | $path = 'mshop/customer/manager/laravel/update'; |
376 | 376 | } |
377 | 377 | |
378 | - $stmt = $this->getCachedStatement( $conn, $path ); |
|
379 | - |
|
380 | - $stmt->bind( 1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
381 | - $stmt->bind( 2, $item->getCode() ); |
|
382 | - $stmt->bind( 3, $billingAddress->getCompany() ); |
|
383 | - $stmt->bind( 4, $billingAddress->getVatID() ); |
|
384 | - $stmt->bind( 5, $billingAddress->getSalutation() ); |
|
385 | - $stmt->bind( 6, $billingAddress->getTitle() ); |
|
386 | - $stmt->bind( 7, $billingAddress->getFirstname() ); |
|
387 | - $stmt->bind( 8, $billingAddress->getLastname() ); |
|
388 | - $stmt->bind( 9, $billingAddress->getAddress1() ); |
|
389 | - $stmt->bind( 10, $billingAddress->getAddress2() ); |
|
390 | - $stmt->bind( 11, $billingAddress->getAddress3() ); |
|
391 | - $stmt->bind( 12, $billingAddress->getPostal() ); |
|
392 | - $stmt->bind( 13, $billingAddress->getCity() ); |
|
393 | - $stmt->bind( 14, $billingAddress->getState() ); |
|
394 | - $stmt->bind( 15, $billingAddress->getCountryId() ); |
|
395 | - $stmt->bind( 16, $billingAddress->getLanguageId() ); |
|
396 | - $stmt->bind( 17, $billingAddress->getTelephone() ); |
|
397 | - $stmt->bind( 18, $billingAddress->getTelefax() ); |
|
398 | - $stmt->bind( 19, $billingAddress->getWebsite() ); |
|
399 | - $stmt->bind( 20, $billingAddress->getEmail() ); |
|
400 | - $stmt->bind( 21, $billingAddress->getLongitude() ); |
|
401 | - $stmt->bind( 22, $billingAddress->getLatitude() ); |
|
402 | - $stmt->bind( 23, $item->getLabel() ); |
|
403 | - $stmt->bind( 24, $item->getBirthday() ); |
|
404 | - $stmt->bind( 25, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
405 | - $stmt->bind( 26, $item->getDateVerified() ); |
|
406 | - $stmt->bind( 27, $item->getPassword() ); |
|
407 | - $stmt->bind( 28, $date ); // Modification time |
|
408 | - $stmt->bind( 29, $context->getEditor() ); |
|
409 | - |
|
410 | - if( $id !== null ) { |
|
411 | - $stmt->bind( 30, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
412 | - $item->setId( $id ); |
|
378 | + $stmt = $this->getCachedStatement($conn, $path); |
|
379 | + |
|
380 | + $stmt->bind(1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
381 | + $stmt->bind(2, $item->getCode()); |
|
382 | + $stmt->bind(3, $billingAddress->getCompany()); |
|
383 | + $stmt->bind(4, $billingAddress->getVatID()); |
|
384 | + $stmt->bind(5, $billingAddress->getSalutation()); |
|
385 | + $stmt->bind(6, $billingAddress->getTitle()); |
|
386 | + $stmt->bind(7, $billingAddress->getFirstname()); |
|
387 | + $stmt->bind(8, $billingAddress->getLastname()); |
|
388 | + $stmt->bind(9, $billingAddress->getAddress1()); |
|
389 | + $stmt->bind(10, $billingAddress->getAddress2()); |
|
390 | + $stmt->bind(11, $billingAddress->getAddress3()); |
|
391 | + $stmt->bind(12, $billingAddress->getPostal()); |
|
392 | + $stmt->bind(13, $billingAddress->getCity()); |
|
393 | + $stmt->bind(14, $billingAddress->getState()); |
|
394 | + $stmt->bind(15, $billingAddress->getCountryId()); |
|
395 | + $stmt->bind(16, $billingAddress->getLanguageId()); |
|
396 | + $stmt->bind(17, $billingAddress->getTelephone()); |
|
397 | + $stmt->bind(18, $billingAddress->getTelefax()); |
|
398 | + $stmt->bind(19, $billingAddress->getWebsite()); |
|
399 | + $stmt->bind(20, $billingAddress->getEmail()); |
|
400 | + $stmt->bind(21, $billingAddress->getLongitude()); |
|
401 | + $stmt->bind(22, $billingAddress->getLatitude()); |
|
402 | + $stmt->bind(23, $item->getLabel()); |
|
403 | + $stmt->bind(24, $item->getBirthday()); |
|
404 | + $stmt->bind(25, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
405 | + $stmt->bind(26, $item->getDateVerified()); |
|
406 | + $stmt->bind(27, $item->getPassword()); |
|
407 | + $stmt->bind(28, $date); // Modification time |
|
408 | + $stmt->bind(29, $context->getEditor()); |
|
409 | + |
|
410 | + if ($id !== null) { |
|
411 | + $stmt->bind(30, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
412 | + $item->setId($id); |
|
413 | 413 | } else { |
414 | - $stmt->bind( 30, $date ); // Creation time |
|
414 | + $stmt->bind(30, $date); // Creation time |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | $stmt->execute()->finish(); |
418 | 418 | |
419 | - if( $id === null && $fetch === true ) |
|
419 | + if ($id === null && $fetch === true) |
|
420 | 420 | { |
421 | 421 | /** mshop/customer/manager/laravel/newid |
422 | 422 | * Retrieves the ID generated by the database when inserting a new record |
@@ -449,22 +449,22 @@ discard block |
||
449 | 449 | * @see mshop/customer/manager/laravel/count |
450 | 450 | */ |
451 | 451 | $path = 'mshop/customer/manager/laravel/newid'; |
452 | - $item->setId( $this->newId( $conn, $path ) ); |
|
452 | + $item->setId($this->newId($conn, $path)); |
|
453 | 453 | } |
454 | 454 | |
455 | - $dbm->release( $conn, $dbname ); |
|
455 | + $dbm->release($conn, $dbname); |
|
456 | 456 | } |
457 | - catch( \Exception $e ) |
|
457 | + catch (\Exception $e) |
|
458 | 458 | { |
459 | - $dbm->release( $conn, $dbname ); |
|
459 | + $dbm->release($conn, $dbname); |
|
460 | 460 | throw $e; |
461 | 461 | } |
462 | 462 | |
463 | - $this->addGroups( $item ); |
|
463 | + $this->addGroups($item); |
|
464 | 464 | |
465 | - $item = $this->savePropertyItems( $item, 'customer' ); |
|
466 | - $item = $this->saveAddressItems( $item, 'customer' ); |
|
467 | - return $this->saveListItems( $item, 'customer' ); |
|
465 | + $item = $this->savePropertyItems($item, 'customer'); |
|
466 | + $item = $this->saveAddressItems($item, 'customer'); |
|
467 | + return $this->saveListItems($item, 'customer'); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
477 | 477 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
478 | 478 | */ |
479 | - public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
|
479 | + public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null) |
|
480 | 480 | { |
481 | 481 | $dbm = $this->getContext()->getDatabaseManager(); |
482 | 482 | $dbname = $this->getResourceName(); |
483 | - $conn = $dbm->acquire( $dbname ); |
|
483 | + $conn = $dbm->acquire($dbname); |
|
484 | 484 | $map = []; |
485 | 485 | |
486 | 486 | try |
@@ -488,32 +488,32 @@ discard block |
||
488 | 488 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
489 | 489 | $cfgPathSearch = 'mshop/customer/manager/laravel/search'; |
490 | 490 | $cfgPathCount = 'mshop/customer/manager/laravel/count'; |
491 | - $required = array( 'customer' ); |
|
491 | + $required = array('customer'); |
|
492 | 492 | |
493 | - $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
|
494 | - while( ( $row = $results->fetch() ) !== false ) { |
|
495 | - $map[ $row['customer.id'] ] = $row; |
|
493 | + $results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level); |
|
494 | + while (($row = $results->fetch()) !== false) { |
|
495 | + $map[$row['customer.id']] = $row; |
|
496 | 496 | } |
497 | 497 | |
498 | - $dbm->release( $conn, $dbname ); |
|
498 | + $dbm->release($conn, $dbname); |
|
499 | 499 | } |
500 | - catch( \Exception $e ) |
|
500 | + catch (\Exception $e) |
|
501 | 501 | { |
502 | - $dbm->release( $conn, $dbname ); |
|
502 | + $dbm->release($conn, $dbname); |
|
503 | 503 | throw $e; |
504 | 504 | } |
505 | 505 | |
506 | 506 | $addrItems = []; |
507 | - if( in_array( 'customer/address', $ref, true ) ) { |
|
508 | - $addrItems = $this->getAddressItems( array_keys( $map ), 'customer' ); |
|
507 | + if (in_array('customer/address', $ref, true)) { |
|
508 | + $addrItems = $this->getAddressItems(array_keys($map), 'customer'); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | $propItems = []; |
512 | - if( in_array( 'customer/property', $ref, true ) ) { |
|
513 | - $propItems = $this->getPropertyItems( array_keys( $map ), 'customer' ); |
|
512 | + if (in_array('customer/property', $ref, true)) { |
|
513 | + $propItems = $this->getPropertyItems(array_keys($map), 'customer'); |
|
514 | 514 | } |
515 | 515 | |
516 | - return $this->buildItems( $map, $ref, 'customer', $addrItems, $propItems ); |
|
516 | + return $this->buildItems($map, $ref, 'customer', $addrItems, $propItems); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | |
@@ -524,8 +524,8 @@ discard block |
||
524 | 524 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
525 | 525 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
526 | 526 | */ |
527 | - public function getSubManager( $manager, $name = null ) |
|
527 | + public function getSubManager($manager, $name = null) |
|
528 | 528 | { |
529 | - return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Laravel' : $name ) ); |
|
529 | + return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Laravel' : $name)); |
|
530 | 530 | } |
531 | 531 | } |
@@ -8,215 +8,215 @@ |
||
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' ); |
|
103 | - |
|
104 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
105 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuad_pid' ); |
|
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 | + |
|
104 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
105 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuad_pid'); |
|
106 | 106 | |
107 | 107 | return $schema; |
108 | 108 | }, |
109 | 109 | |
110 | - 'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
110 | + 'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
111 | 111 | |
112 | - $table = $schema->createTable( 'users_list_type' ); |
|
112 | + $table = $schema->createTable('users_list_type'); |
|
113 | 113 | |
114 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
115 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
116 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
117 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
118 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
119 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
120 | - $table->addColumn( 'status', 'smallint', [] ); |
|
121 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
122 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
123 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
114 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
115 | + $table->addColumn('siteid', 'integer', []); |
|
116 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
117 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
118 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
119 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
120 | + $table->addColumn('status', 'smallint', []); |
|
121 | + $table->addColumn('mtime', 'datetime', []); |
|
122 | + $table->addColumn('ctime', 'datetime', []); |
|
123 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
124 | 124 | |
125 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' ); |
|
126 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' ); |
|
127 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvulity_sid_status_pos' ); |
|
128 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' ); |
|
129 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' ); |
|
125 | + $table->setPrimaryKey(array('id'), 'pk_lvulity_id'); |
|
126 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code'); |
|
127 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvulity_sid_status_pos'); |
|
128 | + $table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label'); |
|
129 | + $table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code'); |
|
130 | 130 | |
131 | 131 | return $schema; |
132 | 132 | }, |
133 | 133 | |
134 | - 'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
135 | - |
|
136 | - $table = $schema->createTable( 'users_list' ); |
|
137 | - |
|
138 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
139 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
140 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
141 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
142 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
143 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
144 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
145 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
146 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
147 | - $table->addColumn( 'pos', 'integer', [] ); |
|
148 | - $table->addColumn( 'status', 'smallint', [] ); |
|
149 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
150 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
151 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
152 | - |
|
153 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' ); |
|
154 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' ); |
|
155 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' ); |
|
156 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' ); |
|
157 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' ); |
|
158 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' ); |
|
159 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' ); |
|
160 | - |
|
161 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
162 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_pid' ); |
|
163 | - |
|
164 | - $table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ), |
|
165 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' ); |
|
134 | + 'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
135 | + |
|
136 | + $table = $schema->createTable('users_list'); |
|
137 | + |
|
138 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
139 | + $table->addColumn('parentid', 'integer', []); |
|
140 | + $table->addColumn('siteid', 'integer', []); |
|
141 | + $table->addColumn('typeid', 'integer', []); |
|
142 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
143 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
144 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
145 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
146 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
147 | + $table->addColumn('pos', 'integer', []); |
|
148 | + $table->addColumn('status', 'smallint', []); |
|
149 | + $table->addColumn('mtime', 'datetime', []); |
|
150 | + $table->addColumn('ctime', 'datetime', []); |
|
151 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
152 | + |
|
153 | + $table->setPrimaryKey(array('id'), 'pk_lvuli_id'); |
|
154 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid'); |
|
155 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end'); |
|
156 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid'); |
|
157 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start'); |
|
158 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end'); |
|
159 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos'); |
|
160 | + |
|
161 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
162 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_pid'); |
|
163 | + |
|
164 | + $table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'), |
|
165 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid'); |
|
166 | 166 | |
167 | 167 | return $schema; |
168 | 168 | }, |
169 | 169 | |
170 | - 'users_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
170 | + 'users_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
171 | 171 | |
172 | - $table = $schema->createTable( 'users_property_type' ); |
|
172 | + $table = $schema->createTable('users_property_type'); |
|
173 | 173 | |
174 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
175 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
176 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
177 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
178 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
179 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
180 | - $table->addColumn( 'status', 'smallint', [] ); |
|
181 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
182 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
183 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
174 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
175 | + $table->addColumn('siteid', 'integer', []); |
|
176 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
177 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
178 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
179 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
180 | + $table->addColumn('status', 'smallint', []); |
|
181 | + $table->addColumn('mtime', 'datetime', []); |
|
182 | + $table->addColumn('ctime', 'datetime', []); |
|
183 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
184 | 184 | |
185 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuprty_id' ); |
|
186 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvuprty_sid_dom_code' ); |
|
187 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvuprty_sid_status_pos' ); |
|
188 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvuprty_sid_label' ); |
|
189 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvuprty_sid_code' ); |
|
185 | + $table->setPrimaryKey(array('id'), 'pk_lvuprty_id'); |
|
186 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvuprty_sid_dom_code'); |
|
187 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvuprty_sid_status_pos'); |
|
188 | + $table->addIndex(array('siteid', 'label'), 'idx_lvuprty_sid_label'); |
|
189 | + $table->addIndex(array('siteid', 'code'), 'idx_lvuprty_sid_code'); |
|
190 | 190 | |
191 | 191 | return $schema; |
192 | 192 | }, |
193 | 193 | |
194 | - 'users_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
194 | + 'users_property' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
195 | 195 | |
196 | - $table = $schema->createTable( 'users_property' ); |
|
196 | + $table = $schema->createTable('users_property'); |
|
197 | 197 | |
198 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
199 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
200 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
201 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
202 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
203 | - $table->addColumn( 'value', 'string', array( 'length' => 255 ) ); |
|
204 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
205 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
206 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
198 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
199 | + $table->addColumn('siteid', 'integer', []); |
|
200 | + $table->addColumn('parentid', 'integer', []); |
|
201 | + $table->addColumn('typeid', 'integer', []); |
|
202 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
203 | + $table->addColumn('value', 'string', array('length' => 255)); |
|
204 | + $table->addColumn('mtime', 'datetime', []); |
|
205 | + $table->addColumn('ctime', 'datetime', []); |
|
206 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
207 | 207 | |
208 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvupr_id' ); |
|
209 | - $table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_lvupr_sid_tid_lid_value' ); |
|
210 | - $table->addIndex( array( 'siteid', 'langid' ), 'idx_lvupr_sid_langid' ); |
|
211 | - $table->addIndex( array( 'siteid', 'value' ), 'idx_lvupr_sid_value' ); |
|
212 | - $table->addIndex( array( 'typeid' ), 'fk_lvupr_typeid' ); |
|
213 | - $table->addIndex( array( 'parentid' ), 'fk_lvupr_pid' ); |
|
208 | + $table->setPrimaryKey(array('id'), 'pk_lvupr_id'); |
|
209 | + $table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_lvupr_sid_tid_lid_value'); |
|
210 | + $table->addIndex(array('siteid', 'langid'), 'idx_lvupr_sid_langid'); |
|
211 | + $table->addIndex(array('siteid', 'value'), 'idx_lvupr_sid_value'); |
|
212 | + $table->addIndex(array('typeid'), 'fk_lvupr_typeid'); |
|
213 | + $table->addIndex(array('parentid'), 'fk_lvupr_pid'); |
|
214 | 214 | |
215 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
216 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_pid' ); |
|
215 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
216 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_pid'); |
|
217 | 217 | |
218 | - $table->addForeignKeyConstraint( 'users_property_type', array( 'typeid' ), array( 'id' ), |
|
219 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_typeid' ); |
|
218 | + $table->addForeignKeyConstraint('users_property_type', array('typeid'), array('id'), |
|
219 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_typeid'); |
|
220 | 220 | |
221 | 221 | return $schema; |
222 | 222 | }, |