@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | protected function setUp() |
23 | 23 | { |
24 | 24 | $this->editor = \TestHelper::getContext()->getEditor(); |
25 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Laravel' ); |
|
25 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Laravel'); |
|
26 | 26 | |
27 | - $listManager = $manager->getSubManager( 'lists', 'Laravel' ); |
|
28 | - $this->object = $listManager->getSubManager( 'type', 'Laravel' ); |
|
27 | + $listManager = $manager->getSubManager('lists', 'Laravel'); |
|
28 | + $this->object = $listManager->getSubManager('type', 'Laravel'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -37,20 +37,20 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function tearDown() |
39 | 39 | { |
40 | - unset( $this->object ); |
|
40 | + unset($this->object); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | public function testCleanup() |
45 | 45 | { |
46 | - $this->object->cleanup( array( -1 ) ); |
|
46 | + $this->object->cleanup(array( -1 )); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testCreateItem() |
51 | 51 | { |
52 | 52 | $item = $this->object->createItem(); |
53 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
53 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -60,18 +60,18 @@ discard block |
||
60 | 60 | $search->setSlice(0, 1); |
61 | 61 | $results = $this->object->searchItems($search); |
62 | 62 | |
63 | - if( ( $expected = reset($results) ) === false ) { |
|
64 | - throw new \RuntimeException( 'No list type item found' ); |
|
63 | + if (($expected = reset($results)) === false) { |
|
64 | + throw new \RuntimeException('No list type item found'); |
|
65 | 65 | } |
66 | 66 | |
67 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
67 | + $this->assertEquals($expected, $this->object->getItem($expected->getId())); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testGetSubManager() |
72 | 72 | { |
73 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
74 | - $this->object->getSubManager( 'unknown' ); |
|
73 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
74 | + $this->object->getSubManager('unknown'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
@@ -81,48 +81,48 @@ discard block |
||
81 | 81 | $search->setSlice(0, 1); |
82 | 82 | $results = $this->object->searchItems($search); |
83 | 83 | |
84 | - if( ( $item = reset($results) ) === false ) { |
|
85 | - throw new \RuntimeException( 'No type item found' ); |
|
84 | + if (($item = reset($results)) === false) { |
|
85 | + throw new \RuntimeException('No type item found'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $item->setId(null); |
89 | - $item->setCode( 'unitTestInit' ); |
|
90 | - $this->object->saveItem( $item ); |
|
91 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
89 | + $item->setCode('unitTestInit'); |
|
90 | + $this->object->saveItem($item); |
|
91 | + $itemSaved = $this->object->getItem($item->getId()); |
|
92 | 92 | |
93 | 93 | $itemExp = clone $itemSaved; |
94 | - $itemExp->setCode( 'unitTestSave' ); |
|
95 | - $this->object->saveItem( $itemExp ); |
|
96 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
94 | + $itemExp->setCode('unitTestSave'); |
|
95 | + $this->object->saveItem($itemExp); |
|
96 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
97 | 97 | |
98 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
98 | + $this->object->deleteItem($itemSaved->getId()); |
|
99 | 99 | |
100 | 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->getCode(), $itemSaved->getCode() ); |
|
105 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
106 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
107 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
101 | + $this->assertTrue($item->getId() !== null); |
|
102 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
103 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
104 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
105 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
106 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
107 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
108 | 108 | |
109 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
110 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
111 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
109 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
110 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
111 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
112 | 112 | |
113 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
114 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
115 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
116 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
117 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
118 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
113 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
114 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
115 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
116 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
117 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
118 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
119 | 119 | |
120 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
121 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
122 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
120 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
121 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
122 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
123 | 123 | |
124 | 124 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
125 | - $this->object->getItem( $itemSaved->getId() ); |
|
125 | + $this->object->getItem($itemSaved->getId()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -132,25 +132,25 @@ discard block |
||
132 | 132 | $search = $this->object->createSearch(); |
133 | 133 | |
134 | 134 | $expr = array(); |
135 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
136 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
137 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
138 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
139 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
140 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
141 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
142 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
143 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
144 | - |
|
145 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
135 | + $expr[] = $search->compare('!=', 'customer.lists.type.id', 0); |
|
136 | + $expr[] = $search->compare('!=', 'customer.lists.type.siteid', null); |
|
137 | + $expr[] = $search->compare('==', 'customer.lists.type.code', 'default'); |
|
138 | + $expr[] = $search->compare('==', 'customer.lists.type.domain', 'text'); |
|
139 | + $expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard'); |
|
140 | + $expr[] = $search->compare('==', 'customer.lists.type.status', 1); |
|
141 | + $expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00'); |
|
142 | + $expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00'); |
|
143 | + $expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor); |
|
144 | + |
|
145 | + $search->setConditions($search->combine('&&', $expr)); |
|
146 | 146 | $search->setSlice(0, 1); |
147 | 147 | |
148 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
149 | - $this->assertEquals( 1, count( $results ) ); |
|
150 | - $this->assertEquals( 1, $total ); |
|
148 | + $results = $this->object->searchItems($search, array(), $total); |
|
149 | + $this->assertEquals(1, count($results)); |
|
150 | + $this->assertEquals(1, $total); |
|
151 | 151 | |
152 | - foreach($results as $itemId => $item) { |
|
153 | - $this->assertEquals( $itemId, $item->getId() ); |
|
152 | + foreach ($results as $itemId => $item) { |
|
153 | + $this->assertEquals($itemId, $item->getId()); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 |
@@ -8,148 +8,148 @@ |
||
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( 'label', 'string', array( 'length' => 255 ) ); |
|
17 | - $table->addColumn( 'name', 'string', array( 'length' => 255 ) ); |
|
18 | - $table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) ); |
|
19 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
20 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
21 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
22 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
23 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
24 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
25 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
26 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
27 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
28 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
29 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
30 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
31 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
32 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
33 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
34 | - $table->addColumn( 'telefax', 'string', array( 'length' => 32 ) ); |
|
35 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
36 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
37 | - $table->addColumn( 'password', 'string', array( 'length' => 255 ) ); |
|
38 | - $table->addColumn( 'birthday', 'date', array( 'notnull' => false ) ); |
|
39 | - $table->addColumn( 'vdate', 'date', array( 'notnull' => false ) ); |
|
40 | - $table->addColumn( 'status', 'smallint', array() ); |
|
41 | - $table->addColumn( 'updated_at', 'datetime', array() ); |
|
42 | - $table->addColumn( 'created_at', 'datetime', array() ); |
|
43 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
44 | - |
|
45 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' ); |
|
46 | - $table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' ); |
|
47 | - $table->addIndex( array( 'langid' ), 'idx_lvusr_langid' ); |
|
48 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' ); |
|
49 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' ); |
|
50 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' ); |
|
51 | - $table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' ); |
|
52 | - $table->addIndex( array( 'address1' ), 'idx_lvusr_address1' ); |
|
53 | - $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('label', 'string', array('length' => 255)); |
|
17 | + $table->addColumn('name', 'string', array('length' => 255)); |
|
18 | + $table->addColumn('remember_token', 'string', array('length' => 100, 'notnull' => false)); |
|
19 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
20 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
21 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
22 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
23 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
24 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
25 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
26 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
27 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
28 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
29 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
30 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
31 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
32 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
33 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
34 | + $table->addColumn('telefax', 'string', array('length' => 32)); |
|
35 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
36 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
37 | + $table->addColumn('password', 'string', array('length' => 255)); |
|
38 | + $table->addColumn('birthday', 'date', array('notnull' => false)); |
|
39 | + $table->addColumn('vdate', 'date', array('notnull' => false)); |
|
40 | + $table->addColumn('status', 'smallint', array()); |
|
41 | + $table->addColumn('updated_at', 'datetime', array()); |
|
42 | + $table->addColumn('created_at', 'datetime', array()); |
|
43 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
44 | + |
|
45 | + $table->setPrimaryKey(array('id'), 'pk_lvusr_id'); |
|
46 | + $table->addUniqueIndex(array('email'), 'unq_lvusr_email'); |
|
47 | + $table->addIndex(array('langid'), 'idx_lvusr_langid'); |
|
48 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvusr_last_first'); |
|
49 | + $table->addIndex(array('postal', 'address1'), 'idx_lvusr_post_addr1'); |
|
50 | + $table->addIndex(array('postal', 'city'), 'idx_lvusr_post_city'); |
|
51 | + $table->addIndex(array('lastname'), 'idx_lvusr_lastname'); |
|
52 | + $table->addIndex(array('address1'), 'idx_lvusr_address1'); |
|
53 | + $table->addIndex(array('city'), 'idx_lvusr_city'); |
|
54 | 54 | |
55 | 55 | return $schema; |
56 | 56 | }, |
57 | 57 | |
58 | - 'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
59 | - |
|
60 | - $table = $schema->createTable( 'users_address' ); |
|
61 | - |
|
62 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
63 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
64 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
65 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
66 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
67 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
68 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
69 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
70 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
71 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
72 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
73 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
74 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
75 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
76 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
77 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
78 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
79 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
81 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
82 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
83 | - $table->addColumn( 'flag', 'integer', array() ); |
|
84 | - $table->addColumn( 'pos', 'smallint', array() ); |
|
85 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
86 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
87 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
88 | - |
|
89 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' ); |
|
90 | - $table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' ); |
|
91 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' ); |
|
92 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' ); |
|
93 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' ); |
|
94 | - $table->addIndex( array( 'address1' ), 'idx_lvusr_address1' ); |
|
95 | - $table->addIndex( array( 'city' ), 'idx_lvuad_city' ); |
|
96 | - $table->addIndex( array( 'email' ), 'idx_lvuad_email' ); |
|
58 | + 'users_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
59 | + |
|
60 | + $table = $schema->createTable('users_address'); |
|
61 | + |
|
62 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
63 | + $table->addColumn('siteid', 'integer', array()); |
|
64 | + $table->addColumn('parentid', 'integer', array()); |
|
65 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
66 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
67 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
68 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
69 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
70 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
71 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
72 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
73 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
74 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
75 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
76 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
77 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
78 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
79 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
80 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
81 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
82 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
83 | + $table->addColumn('flag', 'integer', array()); |
|
84 | + $table->addColumn('pos', 'smallint', array()); |
|
85 | + $table->addColumn('mtime', 'datetime', array()); |
|
86 | + $table->addColumn('ctime', 'datetime', array()); |
|
87 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
88 | + |
|
89 | + $table->setPrimaryKey(array('id'), 'pk_lvuad_id'); |
|
90 | + $table->addIndex(array('parentid'), 'idx_lvuad_pid'); |
|
91 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvuad_last_first'); |
|
92 | + $table->addIndex(array('postal', 'address1'), 'idx_lvuad_post_addr1'); |
|
93 | + $table->addIndex(array('postal', 'city'), 'idx_lvuad_post_city'); |
|
94 | + $table->addIndex(array('address1'), 'idx_lvusr_address1'); |
|
95 | + $table->addIndex(array('city'), 'idx_lvuad_city'); |
|
96 | + $table->addIndex(array('email'), 'idx_lvuad_email'); |
|
97 | 97 | |
98 | 98 | return $schema; |
99 | 99 | }, |
100 | 100 | |
101 | - 'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
101 | + 'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
102 | 102 | |
103 | - $table = $schema->createTable( 'users_list_type' ); |
|
103 | + $table = $schema->createTable('users_list_type'); |
|
104 | 104 | |
105 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
106 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
107 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
108 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
109 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
110 | - $table->addColumn( 'status', 'smallint', array() ); |
|
111 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
112 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
113 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
105 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
106 | + $table->addColumn('siteid', 'integer', array()); |
|
107 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
108 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
109 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
110 | + $table->addColumn('status', 'smallint', array()); |
|
111 | + $table->addColumn('mtime', 'datetime', array()); |
|
112 | + $table->addColumn('ctime', 'datetime', array()); |
|
113 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
114 | 114 | |
115 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' ); |
|
116 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' ); |
|
117 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_lvulity_sid_status' ); |
|
118 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' ); |
|
119 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' ); |
|
115 | + $table->setPrimaryKey(array('id'), 'pk_lvulity_id'); |
|
116 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code'); |
|
117 | + $table->addIndex(array('siteid', 'status'), 'idx_lvulity_sid_status'); |
|
118 | + $table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label'); |
|
119 | + $table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code'); |
|
120 | 120 | |
121 | 121 | return $schema; |
122 | 122 | }, |
123 | 123 | |
124 | - 'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
125 | - |
|
126 | - $table = $schema->createTable( 'users_list' ); |
|
127 | - |
|
128 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
129 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
130 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
131 | - $table->addColumn( 'typeid', 'integer', array() ); |
|
132 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
133 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
134 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
135 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
136 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
137 | - $table->addColumn( 'pos', 'integer', array() ); |
|
138 | - $table->addColumn( 'status', 'smallint', array() ); |
|
139 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
140 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
141 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
142 | - |
|
143 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' ); |
|
144 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' ); |
|
145 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' ); |
|
146 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' ); |
|
147 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' ); |
|
148 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' ); |
|
149 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' ); |
|
150 | - |
|
151 | - $table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ), |
|
152 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' ); |
|
124 | + 'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
125 | + |
|
126 | + $table = $schema->createTable('users_list'); |
|
127 | + |
|
128 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
129 | + $table->addColumn('parentid', 'integer', array()); |
|
130 | + $table->addColumn('siteid', 'integer', array()); |
|
131 | + $table->addColumn('typeid', 'integer', array()); |
|
132 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
133 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
134 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
135 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
136 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
137 | + $table->addColumn('pos', 'integer', array()); |
|
138 | + $table->addColumn('status', 'smallint', array()); |
|
139 | + $table->addColumn('mtime', 'datetime', array()); |
|
140 | + $table->addColumn('ctime', 'datetime', array()); |
|
141 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
142 | + |
|
143 | + $table->setPrimaryKey(array('id'), 'pk_lvuli_id'); |
|
144 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid'); |
|
145 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end'); |
|
146 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid'); |
|
147 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start'); |
|
148 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end'); |
|
149 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos'); |
|
150 | + |
|
151 | + $table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'), |
|
152 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid'); |
|
153 | 153 | |
154 | 154 | return $schema; |
155 | 155 | }, |