@@ -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 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $this->execute( $this->sql['address'] ); |
| 55 | 55 | $this->status( 'done' ); |
| 56 | - } |
|
| 57 | - else |
|
| 56 | + } else |
|
| 58 | 57 | { |
| 59 | 58 | $this->status( 'OK' ); |
| 60 | 59 | } |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | { |
| 67 | 66 | $this->execute( $this->sql['list'] ); |
| 68 | 67 | $this->status( 'done' ); |
| 69 | - } |
|
| 70 | - else |
|
| 68 | + } else |
|
| 71 | 69 | { |
| 72 | 70 | $this->status( 'OK' ); |
| 73 | 71 | } |
@@ -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 | |
@@ -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 | }, |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * @param \Aimeos\MW\Config\Iface $config Configuration object |
| 32 | 32 | * @param string $tempdir Directory for storing temporary files |
| 33 | 33 | */ |
| 34 | - public function __construct( \Illuminate\Filesystem\FilesystemManager $fsm, \Aimeos\MW\Config\Iface $config, $tempdir ) |
|
| 34 | + public function __construct(\Illuminate\Filesystem\FilesystemManager $fsm, \Aimeos\MW\Config\Iface $config, $tempdir) |
|
| 35 | 35 | { |
| 36 | - parent::__construct( $config ); |
|
| 36 | + parent::__construct($config); |
|
| 37 | 37 | |
| 38 | 38 | $this->fsm = $fsm; |
| 39 | 39 | $this->tempdir = $tempdir; |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function __destruct() |
| 47 | 47 | { |
| 48 | - foreach( $this->objects as $key => $object ) { |
|
| 49 | - unset( $this->objects[$key] ); |
|
| 48 | + foreach ($this->objects as $key => $object) { |
|
| 49 | + unset($this->objects[$key]); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $this->objects = []; |
| 62 | 62 | |
| 63 | - return get_object_vars( $this ); |
|
| 63 | + return get_object_vars($this); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
@@ -71,19 +71,19 @@ discard block |
||
| 71 | 71 | * @return \Aimeos\MW\Filesystem\Iface File system object |
| 72 | 72 | * @throws \Aimeos\MW\Filesystem\Exception If an no configuration for that name is found |
| 73 | 73 | */ |
| 74 | - public function get( $name ) |
|
| 74 | + public function get($name) |
|
| 75 | 75 | { |
| 76 | - $key = $this->getConfig( $name ); |
|
| 76 | + $key = $this->getConfig($name); |
|
| 77 | 77 | |
| 78 | - if( is_string( $key ) ) |
|
| 78 | + if (is_string($key)) |
|
| 79 | 79 | { |
| 80 | - if( !isset( $this->objects[$key] ) ) { |
|
| 81 | - $this->objects[$key] = new \Aimeos\MW\Filesystem\Laravel( $this->fsm->disk( $key ), $this->tempdir ); |
|
| 80 | + if (!isset($this->objects[$key])) { |
|
| 81 | + $this->objects[$key] = new \Aimeos\MW\Filesystem\Laravel($this->fsm->disk($key), $this->tempdir); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return $this->objects[$key]; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return parent::get( $name ); |
|
| 87 | + return parent::get($name); |
|
| 88 | 88 | } |
| 89 | 89 | } |
@@ -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\MW\Common\Exception' ); |
|
| 87 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
| 86 | + $this->setExpectedException('\Aimeos\MW\Common\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 | |
@@ -20,91 +20,91 @@ 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' ); |
|
| 23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Laravel'); |
|
| 24 | + $this->object = $manager->getSubManager('property', 'Laravel'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset( $this->object ); |
|
| 30 | + unset($this->object); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 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 | 42 | $item = $this->object->createItem(); |
| 43 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item ); |
|
| 43 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | public function testSaveInvalid() |
| 48 | 48 | { |
| 49 | - $this->setExpectedException( '\Aimeos\MW\Common\Exception' ); |
|
| 50 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
| 49 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
| 50 | + $this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard()); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | public function testSaveUpdateDeleteItem() |
| 55 | 55 | { |
| 56 | 56 | $search = $this->object->createSearch(); |
| 57 | - $search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) ); |
|
| 58 | - $results = $this->object->searchItems( $search ); |
|
| 57 | + $search->setConditions($search->compare('==', 'customer.property.editor', $this->editor)); |
|
| 58 | + $results = $this->object->searchItems($search); |
|
| 59 | 59 | |
| 60 | - if( ( $item = reset($results) ) === false ) { |
|
| 61 | - throw new \RuntimeException( 'No property item found' ); |
|
| 60 | + if (($item = reset($results)) === false) { |
|
| 61 | + throw new \RuntimeException('No property item found'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $item->setId(null); |
| 65 | - $item->setLanguageId( 'en' ); |
|
| 66 | - $resultSaved = $this->object->saveItem( $item ); |
|
| 67 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
| 65 | + $item->setLanguageId('en'); |
|
| 66 | + $resultSaved = $this->object->saveItem($item); |
|
| 67 | + $itemSaved = $this->object->getItem($item->getId()); |
|
| 68 | 68 | |
| 69 | 69 | $itemExp = clone $itemSaved; |
| 70 | - $itemExp->setValue( 'unittest' ); |
|
| 71 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
| 72 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
| 70 | + $itemExp->setValue('unittest'); |
|
| 71 | + $resultUpd = $this->object->saveItem($itemExp); |
|
| 72 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
| 73 | 73 | |
| 74 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
| 74 | + $this->object->deleteItem($itemSaved->getId()); |
|
| 75 | 75 | |
| 76 | 76 | $context = \TestHelper::getContext(); |
| 77 | 77 | |
| 78 | - $this->assertTrue( $item->getId() !== null ); |
|
| 79 | - $this->assertTrue( $itemSaved->getType() !== null ); |
|
| 80 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
| 81 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId() ); |
|
| 82 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
| 83 | - $this->assertEquals( $item->getTypeId(), $itemSaved->getTypeId() ); |
|
| 84 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId() ); |
|
| 85 | - $this->assertEquals( $item->getValue(), $itemSaved->getValue() ); |
|
| 86 | - |
|
| 87 | - $this->assertEquals( $context->getEditor(), $itemSaved->getEditor() ); |
|
| 88 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
| 89 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 90 | - |
|
| 91 | - $this->assertTrue( $itemUpd->getType() !== null ); |
|
| 92 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
| 93 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId() ); |
|
| 94 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
| 95 | - $this->assertEquals( $itemExp->getTypeId(), $itemUpd->getTypeId() ); |
|
| 96 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId() ); |
|
| 97 | - $this->assertEquals( $itemExp->getValue(), $itemUpd->getValue() ); |
|
| 98 | - |
|
| 99 | - $this->assertEquals( $context->getEditor(), $itemUpd->getEditor() ); |
|
| 100 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
| 101 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
| 102 | - |
|
| 103 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
| 104 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
| 105 | - |
|
| 106 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 107 | - $this->object->getItem( $itemSaved->getId() ); |
|
| 78 | + $this->assertTrue($item->getId() !== null); |
|
| 79 | + $this->assertTrue($itemSaved->getType() !== null); |
|
| 80 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
| 81 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
| 82 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
| 83 | + $this->assertEquals($item->getTypeId(), $itemSaved->getTypeId()); |
|
| 84 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
| 85 | + $this->assertEquals($item->getValue(), $itemSaved->getValue()); |
|
| 86 | + |
|
| 87 | + $this->assertEquals($context->getEditor(), $itemSaved->getEditor()); |
|
| 88 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
| 89 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
| 90 | + |
|
| 91 | + $this->assertTrue($itemUpd->getType() !== null); |
|
| 92 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
| 93 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
| 94 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
| 95 | + $this->assertEquals($itemExp->getTypeId(), $itemUpd->getTypeId()); |
|
| 96 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
| 97 | + $this->assertEquals($itemExp->getValue(), $itemUpd->getValue()); |
|
| 98 | + |
|
| 99 | + $this->assertEquals($context->getEditor(), $itemUpd->getEditor()); |
|
| 100 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
| 101 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
| 102 | + |
|
| 103 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
| 104 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
| 105 | + |
|
| 106 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 107 | + $this->object->getItem($itemSaved->getId()); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
@@ -112,19 +112,19 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $search = $this->object->createSearch(); |
| 114 | 114 | $conditions = array( |
| 115 | - $search->compare( '~=', 'customer.property.value', '1'), |
|
| 116 | - $search->compare( '==', 'customer.property.editor', $this->editor ) |
|
| 115 | + $search->compare('~=', 'customer.property.value', '1'), |
|
| 116 | + $search->compare('==', 'customer.property.editor', $this->editor) |
|
| 117 | 117 | ); |
| 118 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 119 | - $results = $this->object->searchItems( $search ); |
|
| 118 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 119 | + $results = $this->object->searchItems($search); |
|
| 120 | 120 | |
| 121 | - if( ($expected = reset($results)) === false ) { |
|
| 122 | - throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) ); |
|
| 121 | + if (($expected = reset($results)) === false) { |
|
| 122 | + throw new \RuntimeException(sprintf('No customer property item found for value "%1$s".', '1')); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $actual = $this->object->getItem( $expected->getId() ); |
|
| 126 | - $this->assertNotEquals( '', $actual->getTypeName() ); |
|
| 127 | - $this->assertEquals( $expected, $actual ); |
|
| 125 | + $actual = $this->object->getItem($expected->getId()); |
|
| 126 | + $this->assertNotEquals('', $actual->getTypeName()); |
|
| 127 | + $this->assertEquals($expected, $actual); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $result = $this->object->getResourceType(); |
| 134 | 134 | |
| 135 | - $this->assertContains( 'customer/property', $result ); |
|
| 136 | - $this->assertContains( 'customer/property/type', $result ); |
|
| 135 | + $this->assertContains('customer/property', $result); |
|
| 136 | + $this->assertContains('customer/property/type', $result); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | public function testGetSearchAttributes() |
| 141 | 141 | { |
| 142 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
| 143 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
| 142 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
| 143 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -151,51 +151,51 @@ discard block |
||
| 151 | 151 | $search = $this->object->createSearch(); |
| 152 | 152 | |
| 153 | 153 | $expr = []; |
| 154 | - $expr[] = $search->compare( '!=', 'customer.property.id', null ); |
|
| 155 | - $expr[] = $search->compare( '!=', 'customer.property.parentid', null ); |
|
| 156 | - $expr[] = $search->compare( '!=', 'customer.property.siteid', null ); |
|
| 157 | - $expr[] = $search->compare( '!=', 'customer.property.typeid', null ); |
|
| 158 | - $expr[] = $search->compare( '==', 'customer.property.languageid', null ); |
|
| 159 | - $expr[] = $search->compare( '==', 'customer.property.value', '1' ); |
|
| 160 | - $expr[] = $search->compare( '==', 'customer.property.editor', $this->editor ); |
|
| 161 | - |
|
| 162 | - $expr[] = $search->compare( '!=', 'customer.property.type.id', null ); |
|
| 163 | - $expr[] = $search->compare( '!=', 'customer.property.type.siteid', null ); |
|
| 164 | - $expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' ); |
|
| 165 | - $expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' ); |
|
| 166 | - $expr[] = $search->compare( '>', 'customer.property.type.label', '' ); |
|
| 167 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
| 168 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
| 169 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
| 170 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
| 171 | - |
|
| 172 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
| 173 | - $results = $this->object->searchItems( $search, [], $total ); |
|
| 174 | - $this->assertEquals( 1, count( $results ) ); |
|
| 154 | + $expr[] = $search->compare('!=', 'customer.property.id', null); |
|
| 155 | + $expr[] = $search->compare('!=', 'customer.property.parentid', null); |
|
| 156 | + $expr[] = $search->compare('!=', 'customer.property.siteid', null); |
|
| 157 | + $expr[] = $search->compare('!=', 'customer.property.typeid', null); |
|
| 158 | + $expr[] = $search->compare('==', 'customer.property.languageid', null); |
|
| 159 | + $expr[] = $search->compare('==', 'customer.property.value', '1'); |
|
| 160 | + $expr[] = $search->compare('==', 'customer.property.editor', $this->editor); |
|
| 161 | + |
|
| 162 | + $expr[] = $search->compare('!=', 'customer.property.type.id', null); |
|
| 163 | + $expr[] = $search->compare('!=', 'customer.property.type.siteid', null); |
|
| 164 | + $expr[] = $search->compare('==', 'customer.property.type.domain', 'customer'); |
|
| 165 | + $expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter'); |
|
| 166 | + $expr[] = $search->compare('>', 'customer.property.type.label', ''); |
|
| 167 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
| 168 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
| 169 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
| 170 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
| 171 | + |
|
| 172 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 173 | + $results = $this->object->searchItems($search, [], $total); |
|
| 174 | + $this->assertEquals(1, count($results)); |
|
| 175 | 175 | |
| 176 | 176 | |
| 177 | 177 | $search = $this->object->createSearch(); |
| 178 | 178 | $conditions = array( |
| 179 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter' ), |
|
| 180 | - $search->compare( '==', 'customer.property.editor', $this->editor ) |
|
| 179 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
| 180 | + $search->compare('==', 'customer.property.editor', $this->editor) |
|
| 181 | 181 | ); |
| 182 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 182 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 183 | 183 | $search->setSlice(0, 1); |
| 184 | - $items = $this->object->searchItems( $search, [], $total ); |
|
| 184 | + $items = $this->object->searchItems($search, [], $total); |
|
| 185 | 185 | |
| 186 | - $this->assertEquals( 1, count( $items ) ); |
|
| 187 | - $this->assertEquals( 1, $total ); |
|
| 186 | + $this->assertEquals(1, count($items)); |
|
| 187 | + $this->assertEquals(1, $total); |
|
| 188 | 188 | |
| 189 | - foreach($items as $itemId => $item) { |
|
| 190 | - $this->assertEquals( $itemId, $item->getId() ); |
|
| 189 | + foreach ($items as $itemId => $item) { |
|
| 190 | + $this->assertEquals($itemId, $item->getId()); |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | public function testGetSubManager() |
| 196 | 196 | { |
| 197 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
| 198 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); |
|
| 197 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); |
|
| 198 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); |
|
| 199 | 199 | |
| 200 | 200 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
| 201 | 201 | $this->object->getSubManager('unknown'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function getPreDependencies() |
| 23 | 23 | { |
| 24 | - return array( 'TablesAddLaravelTestData' ); |
|
| 24 | + return array('TablesAddLaravelTestData'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -30,34 +30,34 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function migrate() |
| 32 | 32 | { |
| 33 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional ); |
|
| 33 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional); |
|
| 34 | 34 | |
| 35 | - $this->msg( 'Adding Laravel customer test data', 0 ); |
|
| 36 | - $this->additional->setEditor( 'ai-laravel:unittest' ); |
|
| 35 | + $this->msg('Adding Laravel customer test data', 0); |
|
| 36 | + $this->additional->setEditor('ai-laravel:unittest'); |
|
| 37 | 37 | |
| 38 | 38 | $parentIds = []; |
| 39 | 39 | $ds = DIRECTORY_SEPARATOR; |
| 40 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
|
| 40 | + $path = __DIR__.$ds.'data'.$ds.'customer.php'; |
|
| 41 | 41 | |
| 42 | - if( ( $testdata = include( $path ) ) == false ){ |
|
| 43 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
| 42 | + if (($testdata = include($path)) == false) { |
|
| 43 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | - $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $this->additional, 'Laravel' ); |
|
| 48 | - $customerAddressManager = $customerManager->getSubManager( 'address', 'Laravel' ); |
|
| 47 | + $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->additional, 'Laravel'); |
|
| 48 | + $customerAddressManager = $customerManager->getSubManager('address', 'Laravel'); |
|
| 49 | 49 | |
| 50 | - $this->cleanupCustomerData( $customerManager, $customerAddressManager ); |
|
| 50 | + $this->cleanupCustomerData($customerManager, $customerAddressManager); |
|
| 51 | 51 | |
| 52 | 52 | $this->conn->begin(); |
| 53 | 53 | |
| 54 | - $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
| 55 | - $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
| 54 | + $parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem()); |
|
| 55 | + $this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds); |
|
| 56 | 56 | |
| 57 | 57 | $this->conn->commit(); |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - $this->status( 'done' ); |
|
| 60 | + $this->status('done'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -67,17 +67,17 @@ discard block |
||
| 67 | 67 | * @param \Aimeos\MShop\Common\Manager\Iface $customerManager Customer manager |
| 68 | 68 | * @param \Aimeos\MShop\Common\Manager\Iface $customerAddressManager Customer address manager |
| 69 | 69 | */ |
| 70 | - protected function cleanupCustomerData( \Aimeos\MShop\Common\Manager\Iface $customerManager, \Aimeos\MShop\Common\Manager\Iface $customerAddressManager ) |
|
| 70 | + protected function cleanupCustomerData(\Aimeos\MShop\Common\Manager\Iface $customerManager, \Aimeos\MShop\Common\Manager\Iface $customerAddressManager) |
|
| 71 | 71 | { |
| 72 | 72 | $search = $customerManager->createSearch(); |
| 73 | - $search->setConditions( $search->compare( '=~', 'customer.code', 'UTC00' ) ); |
|
| 74 | - $customerItems = $customerManager->searchItems( $search ); |
|
| 73 | + $search->setConditions($search->compare('=~', 'customer.code', 'UTC00')); |
|
| 74 | + $customerItems = $customerManager->searchItems($search); |
|
| 75 | 75 | |
| 76 | 76 | $search = $customerAddressManager->createSearch(); |
| 77 | - $search->setConditions( $search->compare( '=~', 'customer.address.email', 'unitCustomer' ) ); |
|
| 78 | - $addressItems = $customerAddressManager->searchItems( $search ); |
|
| 77 | + $search->setConditions($search->compare('=~', 'customer.address.email', 'unitCustomer')); |
|
| 78 | + $addressItems = $customerAddressManager->searchItems($search); |
|
| 79 | 79 | |
| 80 | - $customerAddressManager->deleteItems( array_keys( $addressItems ) ); |
|
| 81 | - $customerManager->deleteItems( array_keys( $customerItems ) ); |
|
| 80 | + $customerAddressManager->deleteItems(array_keys($addressItems)); |
|
| 81 | + $customerManager->deleteItems(array_keys($customerItems)); |
|
| 82 | 82 | } |
| 83 | 83 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function getPreDependencies() |
| 24 | 24 | { |
| 25 | - return array( 'TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData', 'TextAddTestData' ); |
|
| 25 | + return array('TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData', 'TextAddTestData'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -31,27 +31,27 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function migrate() |
| 33 | 33 | { |
| 34 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional ); |
|
| 34 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional); |
|
| 35 | 35 | |
| 36 | - $this->msg( 'Adding customer-list Laravel test data', 0 ); |
|
| 37 | - $this->additional->setEditor( 'ai-laravel:unittest' ); |
|
| 36 | + $this->msg('Adding customer-list Laravel test data', 0); |
|
| 37 | + $this->additional->setEditor('ai-laravel:unittest'); |
|
| 38 | 38 | |
| 39 | 39 | $ds = DIRECTORY_SEPARATOR; |
| 40 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer-list.php'; |
|
| 40 | + $path = __DIR__.$ds.'data'.$ds.'customer-list.php'; |
|
| 41 | 41 | |
| 42 | - if( ( $testdata = include( $path ) ) == false ){ |
|
| 43 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer list domain', $path ) ); |
|
| 42 | + if (($testdata = include($path)) == false) { |
|
| 43 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer list domain', $path)); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $refKeys = []; |
| 47 | - foreach( $testdata['customer/lists'] as $dataset ) { |
|
| 48 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
| 47 | + foreach ($testdata['customer/lists'] as $dataset) { |
|
| 48 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $refIds = []; |
| 52 | - $refIds['text'] = $this->getTextData( $refKeys['text'] ); |
|
| 53 | - $this->addCustomerListData( $testdata, $refIds, 'Laravel' ); |
|
| 52 | + $refIds['text'] = $this->getTextData($refKeys['text']); |
|
| 53 | + $this->addCustomerListData($testdata, $refIds, 'Laravel'); |
|
| 54 | 54 | |
| 55 | - $this->status( 'done' ); |
|
| 55 | + $this->status('done'); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | \ No newline at end of file |