@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function getPreDependencies() |
| 23 | 23 | { |
| 24 | - return array( 'TablesCreateEzpublish' ); |
|
| 24 | + return array('TablesCreateEzpublish'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -41,31 +41,31 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function migrate() |
| 43 | 43 | { |
| 44 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
| 44 | + $this->msg('Adding address fields to ezuser table', 0); |
|
| 45 | 45 | |
| 46 | - $conn = $this->acquire( 'db-customer' ); |
|
| 46 | + $conn = $this->acquire('db-customer'); |
|
| 47 | 47 | $dbal = $conn->getRawObject(); |
| 48 | 48 | |
| 49 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
| 50 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
| 49 | + if (!($dbal instanceof \Doctrine\DBAL\Connection)) { |
|
| 50 | + throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $fromSchema = $dbal->getSchemaManager()->createSchema(); |
| 54 | 54 | $toSchema = clone $fromSchema; |
| 55 | 55 | |
| 56 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
| 57 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
| 56 | + $this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); |
|
| 57 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); |
|
| 58 | 58 | |
| 59 | - $this->release( $conn, 'db-customer' ); |
|
| 59 | + $this->release($conn, 'db-customer'); |
|
| 60 | 60 | |
| 61 | - if( $sql !== [] ) |
|
| 61 | + if ($sql !== []) |
|
| 62 | 62 | { |
| 63 | - $this->executeList( $sql, 'db-customer' ); |
|
| 64 | - $this->status( 'done' ); |
|
| 63 | + $this->executeList($sql, 'db-customer'); |
|
| 64 | + $this->status('done'); |
|
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | 67 | { |
| 68 | - $this->status( 'OK' ); |
|
| 68 | + $this->status('OK'); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -76,38 +76,38 @@ discard block |
||
| 76 | 76 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
| 77 | 77 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
| 78 | 78 | */ |
| 79 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
| 79 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) |
|
| 80 | 80 | { |
| 81 | 81 | $columns = array( |
| 82 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
| 83 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
| 84 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
| 85 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
| 86 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
| 87 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
| 88 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
| 89 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
| 90 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
| 91 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
| 92 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
| 93 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
| 94 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
| 95 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
| 96 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
| 97 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
| 98 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
| 99 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
| 100 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
| 101 | - 'status' => array( 'smallint', [] ), |
|
| 102 | - 'mtime' => array( 'datetime', [] ), |
|
| 103 | - 'ctime' => array( 'datetime', [] ), |
|
| 104 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
| 82 | + 'company' => array('string', array('length' => 100)), |
|
| 83 | + 'vatid' => array('string', array('length' => 32)), |
|
| 84 | + 'salutation' => array('string', array('length' => 8)), |
|
| 85 | + 'title' => array('string', array('length' => 64)), |
|
| 86 | + 'firstname' => array('string', array('length' => 64)), |
|
| 87 | + 'lastname' => array('string', array('length' => 64)), |
|
| 88 | + 'address1' => array('string', array('length' => 255)), |
|
| 89 | + 'address2' => array('string', array('length' => 255)), |
|
| 90 | + 'address3' => array('string', array('length' => 255)), |
|
| 91 | + 'postal' => array('string', array('length' => 16)), |
|
| 92 | + 'city' => array('string', array('length' => 255)), |
|
| 93 | + 'state' => array('string', array('length' => 255)), |
|
| 94 | + 'langid' => array('string', array('length' => 5, 'notnull' => false)), |
|
| 95 | + 'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), |
|
| 96 | + 'telephone' => array('string', array('length' => 32)), |
|
| 97 | + 'telefax' => array('string', array('length' => 32)), |
|
| 98 | + 'website' => array('string', array('length' => 255)), |
|
| 99 | + 'birthday' => array('date', array('notnull' => false)), |
|
| 100 | + 'vdate' => array('date', array('notnull' => false)), |
|
| 101 | + 'status' => array('smallint', []), |
|
| 102 | + 'mtime' => array('datetime', []), |
|
| 103 | + 'ctime' => array('datetime', []), |
|
| 104 | + 'editor' => array('string', array('length' => 255)), |
|
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | - foreach( $columns as $name => $def ) |
|
| 107 | + foreach ($columns as $name => $def) |
|
| 108 | 108 | { |
| 109 | - if( $table->hasColumn( $name ) === false ) { |
|
| 110 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
| 109 | + if ($table->hasColumn($name) === false) { |
|
| 110 | + $table->addColumn($name, $def[0], $def[1]); |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
@@ -121,23 +121,23 @@ discard block |
||
| 121 | 121 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
| 122 | 122 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
| 123 | 123 | */ |
| 124 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
| 124 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) |
|
| 125 | 125 | { |
| 126 | 126 | $indexes = array( |
| 127 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
| 128 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
| 129 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
| 130 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
| 131 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
| 132 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
| 133 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
| 134 | - 'idx_ezpus_city' => array( 'city' ), |
|
| 127 | + 'idx_ezpus_langid' => array('langid'), |
|
| 128 | + 'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), |
|
| 129 | + 'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), |
|
| 130 | + 'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), |
|
| 131 | + 'idx_ezpus_lastname' => array('lastname'), |
|
| 132 | + 'idx_ezpus_address1' => array('address1'), |
|
| 133 | + 'idx_ezpus_postal' => array('postal'), |
|
| 134 | + 'idx_ezpus_city' => array('city'), |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | - foreach( $indexes as $name => $def ) |
|
| 137 | + foreach ($indexes as $name => $def) |
|
| 138 | 138 | { |
| 139 | - if( $table->hasIndex( $name ) === false ) { |
|
| 140 | - $table->addIndex( $def, $name ); |
|
| 139 | + if ($table->hasIndex($name) === false) { |
|
| 140 | + $table->addIndex($def, $name); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |