@@ -5,16 +5,16 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2016 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
8 | +return array( |
|
9 | 9 | 'customer' => array( |
10 | - 'customer/UTC001' => array( 'code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
11 | - 'customer/UTC002' => array( 'code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '0','password' => 'test' ), |
|
12 | - 'customer/UTC003' => array( 'code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
10 | + 'customer/UTC001' => array('code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
11 | + 'customer/UTC002' => array('code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '0', 'password' => 'test'), |
|
12 | + 'customer/UTC003' => array('code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
13 | 13 | ), |
14 | 14 | 'customer/address' => array( |
15 | - array ( 'parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '0' ), |
|
16 | - array ( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
17 | - array ( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
18 | - array ( 'parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '2' ), |
|
15 | + array('parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '0'), |
|
16 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1'), |
|
17 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1'), |
|
18 | + array('parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '2'), |
|
19 | 19 | ), |
20 | 20 | ); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2016 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'customer/lists/type' => array ( |
|
10 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
8 | +return array( |
|
9 | + 'customer/lists/type' => array( |
|
10 | + 'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
11 | 11 | ), |
12 | 12 | |
13 | - 'customer/lists' => array ( |
|
14 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 0, 'status' => 1 ), |
|
15 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 1, 'status' => 1 ), |
|
16 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 2, 'status' => 1 ), |
|
17 | - array( 'parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 3, 'status' => 1 ), |
|
13 | + 'customer/lists' => array( |
|
14 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 0, 'status' => 1), |
|
15 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 1, 'status' => 1), |
|
16 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 2, 'status' => 1), |
|
17 | + array('parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 3, 'status' => 1), |
|
18 | 18 | ), |
19 | 19 | ); |
@@ -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 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function migrate() |
32 | 32 | { |
33 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
33 | + $this->msg('Adding address fields to ezuser table', 0); |
|
34 | 34 | |
35 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
35 | + $dbal = $this->getConnection('db-customer')->getRawObject(); |
|
36 | 36 | |
37 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
38 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
37 | + if (!($dbal instanceof \Doctrine\DBAL\Connection)) { |
|
38 | + throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $comparator = new \Doctrine\DBAL\Schema\Comparator(); |
44 | 44 | $toSchema = clone $fromSchema; |
45 | 45 | |
46 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
47 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
46 | + $this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); |
|
47 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); |
|
48 | 48 | |
49 | - if( $sql !== array() ) |
|
49 | + if ($sql !== array()) |
|
50 | 50 | { |
51 | - $this->executeList( $sql, 'db-customer' ); |
|
52 | - $this->status( 'done' ); |
|
51 | + $this->executeList($sql, 'db-customer'); |
|
52 | + $this->status('done'); |
|
53 | 53 | } |
54 | 54 | else |
55 | 55 | { |
56 | - $this->status( 'OK' ); |
|
56 | + $this->status('OK'); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -64,38 +64,38 @@ discard block |
||
64 | 64 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
65 | 65 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
66 | 66 | */ |
67 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
67 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) |
|
68 | 68 | { |
69 | 69 | $columns = array( |
70 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
71 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
72 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
73 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
74 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
75 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
76 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
77 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
78 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
79 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
80 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
81 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
82 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
83 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
84 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
85 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
86 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
87 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
88 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
89 | - 'status' => array( 'smallint', array() ), |
|
90 | - 'mtime' => array( 'datetime', array() ), |
|
91 | - 'ctime' => array( 'datetime', array() ), |
|
92 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
70 | + 'company' => array('string', array('length' => 100)), |
|
71 | + 'vatid' => array('string', array('length' => 32)), |
|
72 | + 'salutation' => array('string', array('length' => 8)), |
|
73 | + 'title' => array('string', array('length' => 64)), |
|
74 | + 'firstname' => array('string', array('length' => 64)), |
|
75 | + 'lastname' => array('string', array('length' => 64)), |
|
76 | + 'address1' => array('string', array('length' => 255)), |
|
77 | + 'address2' => array('string', array('length' => 255)), |
|
78 | + 'address3' => array('string', array('length' => 255)), |
|
79 | + 'postal' => array('string', array('length' => 16)), |
|
80 | + 'city' => array('string', array('length' => 255)), |
|
81 | + 'state' => array('string', array('length' => 255)), |
|
82 | + 'langid' => array('string', array('length' => 5, 'notnull' => false)), |
|
83 | + 'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), |
|
84 | + 'telephone' => array('string', array('length' => 32)), |
|
85 | + 'telefax' => array('string', array('length' => 32)), |
|
86 | + 'website' => array('string', array('length' => 255)), |
|
87 | + 'birthday' => array('date', array('notnull' => false)), |
|
88 | + 'vdate' => array('date', array('notnull' => false)), |
|
89 | + 'status' => array('smallint', array()), |
|
90 | + 'mtime' => array('datetime', array()), |
|
91 | + 'ctime' => array('datetime', array()), |
|
92 | + 'editor' => array('string', array('length' => 255)), |
|
93 | 93 | ); |
94 | 94 | |
95 | - foreach( $columns as $name => $def ) |
|
95 | + foreach ($columns as $name => $def) |
|
96 | 96 | { |
97 | - if( $table->hasColumn( $name ) === false ) { |
|
98 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
97 | + if ($table->hasColumn($name) === false) { |
|
98 | + $table->addColumn($name, $def[0], $def[1]); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -109,23 +109,23 @@ discard block |
||
109 | 109 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
110 | 110 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
111 | 111 | */ |
112 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
112 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) |
|
113 | 113 | { |
114 | 114 | $indexes = array( |
115 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
116 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
117 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
118 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
119 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
120 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
121 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
122 | - 'idx_ezpus_city' => array( 'city' ), |
|
115 | + 'idx_ezpus_langid' => array('langid'), |
|
116 | + 'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), |
|
117 | + 'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), |
|
118 | + 'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), |
|
119 | + 'idx_ezpus_lastname' => array('lastname'), |
|
120 | + 'idx_ezpus_address1' => array('address1'), |
|
121 | + 'idx_ezpus_postal' => array('postal'), |
|
122 | + 'idx_ezpus_city' => array('city'), |
|
123 | 123 | ); |
124 | 124 | |
125 | - foreach( $indexes as $name => $def ) |
|
125 | + foreach ($indexes as $name => $def) |
|
126 | 126 | { |
127 | - if( $table->hasIndex( $name ) === false ) { |
|
128 | - $table->addIndex( $def, $name ); |
|
127 | + if ($table->hasIndex($name) === false) { |
|
128 | + $table->addIndex($def, $name); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 |
@@ -20,18 +20,18 @@ discard block |
||
20 | 20 | { |
21 | 21 | $context = \TestHelper::getContext(); |
22 | 22 | $this->editor = $context->getEditor(); |
23 | - $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context ); |
|
23 | + $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish($context); |
|
24 | 24 | |
25 | 25 | $search = $customer->createSearch(); |
26 | 26 | $conditions = array( |
27 | - $search->compare( '==', 'customer.code', 'UTC001' ), |
|
28 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
27 | + $search->compare('==', 'customer.code', 'UTC001'), |
|
28 | + $search->compare('==', 'customer.editor', $this->editor) |
|
29 | 29 | ); |
30 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
31 | - $result = $customer->searchItems( $search ); |
|
30 | + $search->setConditions($search->combine('&&', $conditions)); |
|
31 | + $result = $customer->searchItems($search); |
|
32 | 32 | |
33 | - if( ( $customerItem = reset( $result ) ) === false ) { |
|
34 | - throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) ); |
|
33 | + if (($customerItem = reset($result)) === false) { |
|
34 | + throw new \Exception(sprintf('No customer item found for code "%1$s"', 'UTC001')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $this->fixture = array( |
@@ -58,132 +58,132 @@ discard block |
||
58 | 58 | 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
59 | 59 | ); |
60 | 60 | |
61 | - $this->object = $customer->getSubManager( 'address', 'Ezpublish' ); |
|
61 | + $this->object = $customer->getSubManager('address', 'Ezpublish'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | protected function tearDown() |
66 | 66 | { |
67 | - unset( $this->object, $this->fixture ); |
|
67 | + unset($this->object, $this->fixture); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testCleanup() |
72 | 72 | { |
73 | - $this->object->cleanup( array( -1 ) ); |
|
73 | + $this->object->cleanup(array( -1 )); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function testGetSearchAttributes() |
77 | 77 | { |
78 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
79 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
78 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
79 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | public function testGetSubManager() |
84 | 84 | { |
85 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
86 | - $this->object->getSubManager( 'unknown' ); |
|
85 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
86 | + $this->object->getSubManager('unknown'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function testCreateItem() |
90 | 90 | { |
91 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
91 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem()); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | public function testGetItem() |
95 | 95 | { |
96 | 96 | $search = $this->object->createSearch(); |
97 | - $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
97 | + $search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH')); |
|
98 | 98 | |
99 | - $items = $this->object->searchItems( $search ); |
|
99 | + $items = $this->object->searchItems($search); |
|
100 | 100 | |
101 | - if( ( $item = reset( $items ) ) === false ) { |
|
102 | - throw new \Exception( 'No address item with company "ABC" found' ); |
|
101 | + if (($item = reset($items)) === false) { |
|
102 | + throw new \Exception('No address item with company "ABC" found'); |
|
103 | 103 | } |
104 | 104 | |
105 | - $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
105 | + $this->assertEquals($item, $this->object->getItem($item->getId())); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public function testSaveUpdateDeleteItem() |
109 | 109 | { |
110 | - $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
111 | - $item->setId( null ); |
|
112 | - $this->object->saveItem( $item ); |
|
113 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
110 | + $item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture); |
|
111 | + $item->setId(null); |
|
112 | + $this->object->saveItem($item); |
|
113 | + $itemSaved = $this->object->getItem($item->getId()); |
|
114 | 114 | |
115 | 115 | $itemExp = clone $itemSaved; |
116 | - $itemExp->setPosition( 1 ); |
|
117 | - $itemExp->setCity( 'Berlin' ); |
|
118 | - $itemExp->setState( 'Berlin' ); |
|
119 | - $this->object->saveItem( $itemExp ); |
|
120 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
121 | - |
|
122 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
123 | - |
|
124 | - |
|
125 | - $this->assertTrue( $item->getId() !== null ); |
|
126 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
127 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
128 | - $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
129 | - $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
130 | - $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
131 | - $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | - $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
133 | - $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | - $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
135 | - $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | - $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | - $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | - $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
139 | - $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
140 | - $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
141 | - $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | - $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | - $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
145 | - $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | - $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | - $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
148 | - |
|
149 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
150 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
116 | + $itemExp->setPosition(1); |
|
117 | + $itemExp->setCity('Berlin'); |
|
118 | + $itemExp->setState('Berlin'); |
|
119 | + $this->object->saveItem($itemExp); |
|
120 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
121 | + |
|
122 | + $this->object->deleteItem($itemSaved->getId()); |
|
123 | + |
|
124 | + |
|
125 | + $this->assertTrue($item->getId() !== null); |
|
126 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
127 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
128 | + $this->assertEquals($item->getPosition(), $itemSaved->getPosition()); |
|
129 | + $this->assertEquals($item->getCompany(), $itemSaved->getCompany()); |
|
130 | + $this->assertEquals($item->getVatID(), $itemSaved->getVatID()); |
|
131 | + $this->assertEquals($item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | + $this->assertEquals($item->getTitle(), $itemSaved->getTitle()); |
|
133 | + $this->assertEquals($item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | + $this->assertEquals($item->getLastname(), $itemSaved->getLastname()); |
|
135 | + $this->assertEquals($item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | + $this->assertEquals($item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | + $this->assertEquals($item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | + $this->assertEquals($item->getPostal(), $itemSaved->getPostal()); |
|
139 | + $this->assertEquals($item->getCity(), $itemSaved->getCity()); |
|
140 | + $this->assertEquals($item->getState(), $itemSaved->getState()); |
|
141 | + $this->assertEquals($item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | + $this->assertEquals($item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | + $this->assertEquals($item->getEmail(), $itemSaved->getEmail()); |
|
145 | + $this->assertEquals($item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | + $this->assertEquals($item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | + $this->assertEquals($item->getFlag(), $itemSaved->getFlag()); |
|
148 | + |
|
149 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
150 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
151 | 151 | $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
152 | 152 | |
153 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
154 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | - $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | - $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | - $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | - $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | - $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | - $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | - $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | - $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | - $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | - $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | - $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | - $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
167 | - $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
168 | - $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | - $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | - $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | - $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | - $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | - $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | - |
|
176 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
177 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
178 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
153 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
154 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | + $this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | + $this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | + $this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | + $this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | + $this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | + $this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | + $this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | + $this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | + $this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | + $this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | + $this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | + $this->assertEquals($itemExp->getCity(), $itemUpd->getCity()); |
|
167 | + $this->assertEquals($itemExp->getState(), $itemUpd->getState()); |
|
168 | + $this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | + $this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | + $this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | + $this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | + $this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | + $this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | + |
|
176 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
177 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
178 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
179 | 179 | |
180 | 180 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
181 | - $this->object->getItem( $itemSaved->getId() ); |
|
181 | + $this->object->getItem($itemSaved->getId()); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public function testCreateSearch() |
185 | 185 | { |
186 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
186 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $search = $this->object->createSearch(); |
193 | 193 | |
194 | 194 | $conditions = array( |
195 | - $search->compare( '==', 'customer.address.company', 'ABC' ), |
|
196 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
195 | + $search->compare('==', 'customer.address.company', 'ABC'), |
|
196 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
197 | 197 | ); |
198 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
199 | - $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
198 | + $search->setConditions($search->combine('&&', $conditions)); |
|
199 | + $this->assertEquals(1, count($this->object->searchItems($search))); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -206,20 +206,20 @@ discard block |
||
206 | 206 | $search = $this->object->createSearch(); |
207 | 207 | |
208 | 208 | $conditions = array( |
209 | - $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
210 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
209 | + $search->compare('~=', 'customer.address.company', 'ABC GmbH'), |
|
210 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
211 | 211 | ); |
212 | 212 | |
213 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
214 | - $search->setSlice( 0, 1 ); |
|
213 | + $search->setConditions($search->combine('&&', $conditions)); |
|
214 | + $search->setSlice(0, 1); |
|
215 | 215 | |
216 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
216 | + $results = $this->object->searchItems($search, array(), $total); |
|
217 | 217 | |
218 | - $this->assertEquals( 1, count( $results ) ); |
|
219 | - $this->assertEquals( 2, $total ); |
|
218 | + $this->assertEquals(1, count($results)); |
|
219 | + $this->assertEquals(2, $total); |
|
220 | 220 | |
221 | - foreach( $results as $id => $item ) { |
|
222 | - $this->assertEquals( $id, $item->getId() ); |
|
221 | + foreach ($results as $id => $item) { |
|
222 | + $this->assertEquals($id, $item->getId()); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | } |
@@ -18,36 +18,36 @@ discard block |
||
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | 20 | $this->editor = \TestHelper::getContext()->getEditor(); |
21 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
21 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); |
|
22 | 22 | |
23 | - $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
24 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
23 | + $listManager = $manager->getSubManager('lists', 'Ezpublish'); |
|
24 | + $this->object = $listManager->getSubManager('type', 'Ezpublish'); |
|
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 testGetSubManager() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
43 | - $this->object->getSubManager( 'unknown' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
43 | + $this->object->getSubManager('unknown'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testCreateItem() |
48 | 48 | { |
49 | 49 | $item = $this->object->createItem(); |
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
50 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $search->setSlice(0, 1); |
58 | 58 | $results = $this->object->searchItems($search); |
59 | 59 | |
60 | - if( ( $expected = reset($results) ) === false ) { |
|
61 | - throw new \Exception( 'No list type item found' ); |
|
60 | + if (($expected = reset($results)) === false) { |
|
61 | + throw new \Exception('No list type item found'); |
|
62 | 62 | } |
63 | 63 | |
64 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
64 | + $this->assertEquals($expected, $this->object->getItem($expected->getId())); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -71,48 +71,48 @@ discard block |
||
71 | 71 | $search->setSlice(0, 1); |
72 | 72 | $results = $this->object->searchItems($search); |
73 | 73 | |
74 | - if( ( $item = reset($results) ) === false ) { |
|
75 | - throw new \Exception( 'No type item found' ); |
|
74 | + if (($item = reset($results)) === false) { |
|
75 | + throw new \Exception('No type item found'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $item->setId(null); |
79 | - $item->setCode( 'unitTestInit' ); |
|
80 | - $this->object->saveItem( $item ); |
|
81 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
79 | + $item->setCode('unitTestInit'); |
|
80 | + $this->object->saveItem($item); |
|
81 | + $itemSaved = $this->object->getItem($item->getId()); |
|
82 | 82 | |
83 | 83 | $itemExp = clone $itemSaved; |
84 | - $itemExp->setCode( 'unitTestSave' ); |
|
85 | - $this->object->saveItem( $itemExp ); |
|
86 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
84 | + $itemExp->setCode('unitTestSave'); |
|
85 | + $this->object->saveItem($itemExp); |
|
86 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
87 | 87 | |
88 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
88 | + $this->object->deleteItem($itemSaved->getId()); |
|
89 | 89 | |
90 | 90 | |
91 | - $this->assertTrue( $item->getId() !== null ); |
|
92 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
93 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
94 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
95 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
96 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
97 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
91 | + $this->assertTrue($item->getId() !== null); |
|
92 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
93 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
94 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
95 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
96 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
97 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
98 | 98 | |
99 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
100 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
101 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
99 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
100 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
101 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
102 | 102 | |
103 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
104 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
105 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
106 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
107 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
108 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
103 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
104 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
105 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
106 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
107 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
108 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
109 | 109 | |
110 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
111 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
112 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
110 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
111 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
112 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
113 | 113 | |
114 | 114 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
115 | - $this->object->getItem( $itemSaved->getId() ); |
|
115 | + $this->object->getItem($itemSaved->getId()); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -122,25 +122,25 @@ discard block |
||
122 | 122 | $search = $this->object->createSearch(); |
123 | 123 | |
124 | 124 | $expr = array(); |
125 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
126 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
127 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
128 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
129 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
130 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
131 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
132 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
133 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
134 | - |
|
135 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
125 | + $expr[] = $search->compare('!=', 'customer.lists.type.id', 0); |
|
126 | + $expr[] = $search->compare('!=', 'customer.lists.type.siteid', null); |
|
127 | + $expr[] = $search->compare('==', 'customer.lists.type.code', 'default'); |
|
128 | + $expr[] = $search->compare('==', 'customer.lists.type.domain', 'text'); |
|
129 | + $expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard'); |
|
130 | + $expr[] = $search->compare('==', 'customer.lists.type.status', 1); |
|
131 | + $expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00'); |
|
132 | + $expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00'); |
|
133 | + $expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor); |
|
134 | + |
|
135 | + $search->setConditions($search->combine('&&', $expr)); |
|
136 | 136 | $search->setSlice(0, 1); |
137 | 137 | |
138 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
139 | - $this->assertEquals( 1, count( $results ) ); |
|
140 | - $this->assertEquals( 1, $total ); |
|
138 | + $results = $this->object->searchItems($search, array(), $total); |
|
139 | + $this->assertEquals(1, count($results)); |
|
140 | + $this->assertEquals(1, $total); |
|
141 | 141 | |
142 | - foreach($results as $itemId => $item) { |
|
143 | - $this->assertEquals( $itemId, $item->getId() ); |
|
142 | + foreach ($results as $itemId => $item) { |
|
143 | + $this->assertEquals($itemId, $item->getId()); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 |
@@ -8,135 +8,135 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | 12 | |
13 | - $table = $schema->createTable( 'ezuser' ); |
|
13 | + $table = $schema->createTable('ezuser'); |
|
14 | 14 | |
15 | - $table->addColumn( 'contentobject_id', 'integer', array() ); |
|
16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
15 | + $table->addColumn('contentobject_id', 'integer', array()); |
|
16 | + $table->addColumn('email', 'string', array('length' => 150)); |
|
17 | + $table->addColumn('login', 'string', array('length' => 150)); |
|
18 | + $table->addColumn('login_normalized', 'string', array('length' => 150)); |
|
19 | + $table->addColumn('password_hash', 'string', array('length' => 50)); |
|
20 | + $table->addColumn('password_hash_type', 'integer', array('default' => 1)); |
|
21 | 21 | |
22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
22 | + $table->setPrimaryKey(array('contentobject_id')); |
|
23 | + $table->addUniqueIndex(array('login_normalized'), 'ezuser_login'); |
|
24 | 24 | |
25 | 25 | return $schema; |
26 | 26 | }, |
27 | 27 | |
28 | - 'ezuser_setting' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
28 | + 'ezuser_setting' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
29 | 29 | |
30 | - $table = $schema->createTable( 'ezuser_setting' ); |
|
30 | + $table = $schema->createTable('ezuser_setting'); |
|
31 | 31 | |
32 | - $table->addColumn( 'is_enabled', 'integer', array() ); |
|
33 | - $table->addColumn( 'max_login', 'integer', array( 'notnull' => false ) ); |
|
34 | - $table->addColumn( 'user_id', 'integer', array() ); |
|
32 | + $table->addColumn('is_enabled', 'integer', array()); |
|
33 | + $table->addColumn('max_login', 'integer', array('notnull' => false)); |
|
34 | + $table->addColumn('user_id', 'integer', array()); |
|
35 | 35 | |
36 | - $table->setPrimaryKey( array( 'user_id' ) ); |
|
36 | + $table->setPrimaryKey(array('user_id')); |
|
37 | 37 | |
38 | 38 | return $schema; |
39 | 39 | }, |
40 | 40 | |
41 | - 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
42 | - |
|
43 | - $table = $schema->createTable( 'ezuser_address' ); |
|
44 | - |
|
45 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
46 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
47 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
48 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
49 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
50 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
51 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
52 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
53 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
54 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
55 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
56 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
57 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
58 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
59 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
60 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
61 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
62 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
63 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
64 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
65 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
66 | - $table->addColumn( 'flag', 'integer', array() ); |
|
67 | - $table->addColumn( 'pos', 'smallint', array() ); |
|
68 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
69 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
70 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
71 | - |
|
72 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
73 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
74 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
75 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
76 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
77 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
78 | - |
|
79 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
80 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
41 | + 'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
42 | + |
|
43 | + $table = $schema->createTable('ezuser_address'); |
|
44 | + |
|
45 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
46 | + $table->addColumn('siteid', 'integer', array()); |
|
47 | + $table->addColumn('parentid', 'integer', array()); |
|
48 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
49 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
50 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
51 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
52 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
53 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
54 | + $table->addColumn('address1', 'string', array('length' => 255)); |
|
55 | + $table->addColumn('address2', 'string', array('length' => 255)); |
|
56 | + $table->addColumn('address3', 'string', array('length' => 255)); |
|
57 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
58 | + $table->addColumn('city', 'string', array('length' => 255)); |
|
59 | + $table->addColumn('state', 'string', array('length' => 255)); |
|
60 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
61 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
62 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
63 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
64 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
65 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
66 | + $table->addColumn('flag', 'integer', array()); |
|
67 | + $table->addColumn('pos', 'smallint', array()); |
|
68 | + $table->addColumn('mtime', 'datetime', array()); |
|
69 | + $table->addColumn('ctime', 'datetime', array()); |
|
70 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
71 | + |
|
72 | + $table->setPrimaryKey(array('id'), 'pk_ezpad_id'); |
|
73 | + $table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn'); |
|
74 | + $table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2'); |
|
75 | + $table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci'); |
|
76 | + $table->addIndex(array('parentid'), 'idx_ezpad_pid'); |
|
77 | + $table->addIndex(array('city'), 'idx_ezpad_city'); |
|
78 | + |
|
79 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
80 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid'); |
|
81 | 81 | |
82 | 82 | return $schema; |
83 | 83 | }, |
84 | 84 | |
85 | - 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
85 | + 'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
86 | 86 | |
87 | - $table = $schema->createTable( 'ezuser_list_type' ); |
|
87 | + $table = $schema->createTable('ezuser_list_type'); |
|
88 | 88 | |
89 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
90 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
91 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
92 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
93 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
94 | - $table->addColumn( 'status', 'smallint', array() ); |
|
95 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
96 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
97 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
89 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
90 | + $table->addColumn('siteid', 'integer', array()); |
|
91 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
92 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
93 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
94 | + $table->addColumn('status', 'smallint', array()); |
|
95 | + $table->addColumn('mtime', 'datetime', array()); |
|
96 | + $table->addColumn('ctime', 'datetime', array()); |
|
97 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
98 | 98 | |
99 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
100 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
101 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
102 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
103 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
99 | + $table->setPrimaryKey(array('id'), 'pk_ezplity_id'); |
|
100 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code'); |
|
101 | + $table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status'); |
|
102 | + $table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label'); |
|
103 | + $table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code'); |
|
104 | 104 | |
105 | 105 | return $schema; |
106 | 106 | }, |
107 | 107 | |
108 | - 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
109 | - |
|
110 | - $table = $schema->createTable( 'ezuser_list' ); |
|
111 | - |
|
112 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
113 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
114 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
115 | - $table->addColumn( 'typeid', 'integer', array() ); |
|
116 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
117 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
118 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
119 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
120 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
121 | - $table->addColumn( 'pos', 'integer', array() ); |
|
122 | - $table->addColumn( 'status', 'smallint', array() ); |
|
123 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
124 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
125 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
126 | - |
|
127 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
128 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
129 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
130 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
131 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
132 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
133 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
134 | - |
|
135 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
136 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
137 | - |
|
138 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
139 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
108 | + 'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
109 | + |
|
110 | + $table = $schema->createTable('ezuser_list'); |
|
111 | + |
|
112 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
113 | + $table->addColumn('parentid', 'integer', array()); |
|
114 | + $table->addColumn('siteid', 'integer', array()); |
|
115 | + $table->addColumn('typeid', 'integer', array()); |
|
116 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
117 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
118 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
119 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
120 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
121 | + $table->addColumn('pos', 'integer', array()); |
|
122 | + $table->addColumn('status', 'smallint', array()); |
|
123 | + $table->addColumn('mtime', 'datetime', array()); |
|
124 | + $table->addColumn('ctime', 'datetime', array()); |
|
125 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
126 | + |
|
127 | + $table->setPrimaryKey(array('id'), 'pk_ezpli_id'); |
|
128 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid'); |
|
129 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end'); |
|
130 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid'); |
|
131 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start'); |
|
132 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end'); |
|
133 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos'); |
|
134 | + |
|
135 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
136 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid'); |
|
137 | + |
|
138 | + $table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'), |
|
139 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid'); |
|
140 | 140 | |
141 | 141 | return $schema; |
142 | 142 | }, |
@@ -26,8 +26,8 @@ |
||
26 | 26 | * @param string|null $salt Password salt |
27 | 27 | * @return string Hashed password |
28 | 28 | */ |
29 | - public function encode( $password, $salt = null ) |
|
29 | + public function encode($password, $salt = null) |
|
30 | 30 | { |
31 | - return md5( $salt . "\n" . $password ); |
|
31 | + return md5($salt."\n".$password); |
|
32 | 32 | } |
33 | 33 | } |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | * @param string $salt Password salt (optional) |
34 | 34 | * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object |
35 | 35 | */ |
36 | - public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(), |
|
36 | + public function __construct(\Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(), |
|
37 | 37 | array $listItems = array(), array $refItems = array(), $salt = '', |
38 | - \Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null ) |
|
38 | + \Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null) |
|
39 | 39 | { |
40 | - parent::__construct( $address, $values, $listItems, $refItems ); |
|
40 | + parent::__construct($address, $values, $listItems, $refItems); |
|
41 | 41 | |
42 | - if( isset( $values['customer.password'] ) ) { |
|
42 | + if (isset($values['customer.password'])) { |
|
43 | 43 | $this->password = $values['customer.password']; |
44 | 44 | } |
45 | 45 | |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | * @param string $value password of the customer item |
65 | 65 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls |
66 | 66 | */ |
67 | - public function setPassword( $value ) |
|
67 | + public function setPassword($value) |
|
68 | 68 | { |
69 | - if( $value == $this->getPassword() ) { return $this; } |
|
69 | + if ($value == $this->getPassword()) { return $this; } |
|
70 | 70 | |
71 | - if( $this->helper !== null ) { |
|
72 | - $value = $this->helper->encode( $value, $this->getCode() ); |
|
71 | + if ($this->helper !== null) { |
|
72 | + $value = $this->helper->encode($value, $this->getCode()); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $this->password = (string) $value; |
@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | * |
229 | 229 | * @param array $siteids List of IDs for sites whose entries should be deleted |
230 | 230 | */ |
231 | - public function cleanup( array $siteids ) |
|
231 | + public function cleanup(array $siteids) |
|
232 | 232 | { |
233 | 233 | $path = 'mshop/customer/manager/submanagers'; |
234 | - foreach( $this->getContext()->getConfig()->get( $path, array( 'address', 'lists' ) ) as $domain ) { |
|
235 | - $this->getSubManager( $domain )->cleanup( $siteids ); |
|
234 | + foreach ($this->getContext()->getConfig()->get($path, array('address', 'lists')) as $domain) { |
|
235 | + $this->getSubManager($domain)->cleanup($siteids); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param array $ids List of IDs |
244 | 244 | */ |
245 | - public function deleteItems( array $ids ) |
|
245 | + public function deleteItems(array $ids) |
|
246 | 246 | { |
247 | 247 | $path = 'mshop/customer/manager/ezpublish/delete'; |
248 | - $this->deleteItemsBase( $ids, $path, false, 'contentobject_id' ); |
|
248 | + $this->deleteItemsBase($ids, $path, false, 'contentobject_id'); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | * @param boolean $withsub Return also attributes of sub-managers if true |
256 | 256 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
257 | 257 | */ |
258 | - public function getSearchAttributes( $withsub = true ) |
|
258 | + public function getSearchAttributes($withsub = true) |
|
259 | 259 | { |
260 | 260 | $path = 'mshop/customer/manager/submanagers'; |
261 | 261 | |
262 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, array( 'address', 'lists' ), $withsub ); |
|
262 | + return $this->getSearchAttributesBase($this->searchConfig, $path, array('address', 'lists'), $withsub); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
@@ -280,71 +280,71 @@ discard block |
||
280 | 280 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
281 | 281 | * @param boolean $fetch True if the new ID should be returned in the item |
282 | 282 | */ |
283 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
283 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
284 | 284 | { |
285 | 285 | $iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface'; |
286 | - if( !( $item instanceof $iface ) ) { |
|
287 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
286 | + if (!($item instanceof $iface)) { |
|
287 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
288 | 288 | } |
289 | 289 | |
290 | - if( !$item->isModified() ) { return; } |
|
290 | + if (!$item->isModified()) { return; } |
|
291 | 291 | |
292 | 292 | $context = $this->getContext(); |
293 | 293 | |
294 | 294 | $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
295 | - if( !is_a( $context, $class ) ) { |
|
296 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $class ) ); |
|
295 | + if (!is_a($context, $class)) { |
|
296 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $class)); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | $fcn = $context->getEzUser(); |
300 | 300 | $email = $item->getPaymentAddress()->getEmail(); |
301 | - $contentId = $fcn( $item->getId(), $item->getCode(), $email, $item->getPassword(), $item->getStatus() ); |
|
302 | - $item->setId( $contentId ); |
|
301 | + $contentId = $fcn($item->getId(), $item->getCode(), $email, $item->getPassword(), $item->getStatus()); |
|
302 | + $item->setId($contentId); |
|
303 | 303 | |
304 | 304 | $dbm = $context->getDatabaseManager(); |
305 | 305 | $dbname = $this->getResourceName(); |
306 | - $conn = $dbm->acquire( $dbname ); |
|
306 | + $conn = $dbm->acquire($dbname); |
|
307 | 307 | |
308 | 308 | try |
309 | 309 | { |
310 | - $date = date( 'Y-m-d H:i:s' ); |
|
311 | - $ctime = ( $item->getTimeCreated() ? $item->getTimeCreated() : $date ); |
|
310 | + $date = date('Y-m-d H:i:s'); |
|
311 | + $ctime = ($item->getTimeCreated() ? $item->getTimeCreated() : $date); |
|
312 | 312 | $billingAddress = $item->getPaymentAddress(); |
313 | 313 | |
314 | 314 | $path = 'mshop/customer/manager/ezpublish/update'; |
315 | - $stmt = $this->getCachedStatement( $conn, $path ); |
|
316 | - |
|
317 | - $stmt->bind( 1, $billingAddress->getCompany() ); |
|
318 | - $stmt->bind( 2, $billingAddress->getVatID() ); |
|
319 | - $stmt->bind( 3, $billingAddress->getSalutation() ); |
|
320 | - $stmt->bind( 4, $billingAddress->getTitle() ); |
|
321 | - $stmt->bind( 5, $billingAddress->getFirstname() ); |
|
322 | - $stmt->bind( 6, $billingAddress->getLastname() ); |
|
323 | - $stmt->bind( 7, $billingAddress->getAddress1() ); |
|
324 | - $stmt->bind( 8, $billingAddress->getAddress2() ); |
|
325 | - $stmt->bind( 9, $billingAddress->getAddress3() ); |
|
326 | - $stmt->bind( 10, $billingAddress->getPostal() ); |
|
327 | - $stmt->bind( 11, $billingAddress->getCity() ); |
|
328 | - $stmt->bind( 12, $billingAddress->getState() ); |
|
329 | - $stmt->bind( 13, $billingAddress->getCountryId() ); |
|
330 | - $stmt->bind( 14, $billingAddress->getLanguageId() ); |
|
331 | - $stmt->bind( 15, $billingAddress->getTelephone() ); |
|
332 | - $stmt->bind( 16, $billingAddress->getTelefax() ); |
|
333 | - $stmt->bind( 17, $billingAddress->getWebsite() ); |
|
334 | - $stmt->bind( 18, $item->getBirthday() ); |
|
335 | - $stmt->bind( 19, $item->getDateVerified() ); |
|
336 | - $stmt->bind( 20, $date ); // Modification time |
|
337 | - $stmt->bind( 21, $context->getEditor() ); |
|
338 | - $stmt->bind( 22, $ctime ); // Creation time |
|
339 | - $stmt->bind( 23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
315 | + $stmt = $this->getCachedStatement($conn, $path); |
|
316 | + |
|
317 | + $stmt->bind(1, $billingAddress->getCompany()); |
|
318 | + $stmt->bind(2, $billingAddress->getVatID()); |
|
319 | + $stmt->bind(3, $billingAddress->getSalutation()); |
|
320 | + $stmt->bind(4, $billingAddress->getTitle()); |
|
321 | + $stmt->bind(5, $billingAddress->getFirstname()); |
|
322 | + $stmt->bind(6, $billingAddress->getLastname()); |
|
323 | + $stmt->bind(7, $billingAddress->getAddress1()); |
|
324 | + $stmt->bind(8, $billingAddress->getAddress2()); |
|
325 | + $stmt->bind(9, $billingAddress->getAddress3()); |
|
326 | + $stmt->bind(10, $billingAddress->getPostal()); |
|
327 | + $stmt->bind(11, $billingAddress->getCity()); |
|
328 | + $stmt->bind(12, $billingAddress->getState()); |
|
329 | + $stmt->bind(13, $billingAddress->getCountryId()); |
|
330 | + $stmt->bind(14, $billingAddress->getLanguageId()); |
|
331 | + $stmt->bind(15, $billingAddress->getTelephone()); |
|
332 | + $stmt->bind(16, $billingAddress->getTelefax()); |
|
333 | + $stmt->bind(17, $billingAddress->getWebsite()); |
|
334 | + $stmt->bind(18, $item->getBirthday()); |
|
335 | + $stmt->bind(19, $item->getDateVerified()); |
|
336 | + $stmt->bind(20, $date); // Modification time |
|
337 | + $stmt->bind(21, $context->getEditor()); |
|
338 | + $stmt->bind(22, $ctime); // Creation time |
|
339 | + $stmt->bind(23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
340 | 340 | |
341 | 341 | $stmt->execute()->finish(); |
342 | 342 | |
343 | - $dbm->release( $conn, $dbname ); |
|
343 | + $dbm->release($conn, $dbname); |
|
344 | 344 | } |
345 | - catch( \Exception $e ) |
|
345 | + catch (\Exception $e) |
|
346 | 346 | { |
347 | - $dbm->release( $conn, $dbname ); |
|
347 | + $dbm->release($conn, $dbname); |
|
348 | 348 | throw $e; |
349 | 349 | } |
350 | 350 | } |
@@ -358,11 +358,11 @@ discard block |
||
358 | 358 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
359 | 359 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
360 | 360 | */ |
361 | - public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null ) |
|
361 | + public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null) |
|
362 | 362 | { |
363 | 363 | $dbm = $this->getContext()->getDatabaseManager(); |
364 | 364 | $dbname = $this->getResourceName(); |
365 | - $conn = $dbm->acquire( $dbname ); |
|
365 | + $conn = $dbm->acquire($dbname); |
|
366 | 366 | $map = array(); |
367 | 367 | |
368 | 368 | try |
@@ -370,22 +370,22 @@ discard block |
||
370 | 370 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
371 | 371 | $cfgPathSearch = 'mshop/customer/manager/ezpublish/search'; |
372 | 372 | $cfgPathCount = 'mshop/customer/manager/ezpublish/count'; |
373 | - $required = array( 'customer' ); |
|
373 | + $required = array('customer'); |
|
374 | 374 | |
375 | - $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
|
376 | - while( ( $row = $results->fetch() ) !== false ) { |
|
377 | - $map[ $row['customer.id'] ] = $row; |
|
375 | + $results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level); |
|
376 | + while (($row = $results->fetch()) !== false) { |
|
377 | + $map[$row['customer.id']] = $row; |
|
378 | 378 | } |
379 | 379 | |
380 | - $dbm->release( $conn, $dbname ); |
|
380 | + $dbm->release($conn, $dbname); |
|
381 | 381 | } |
382 | - catch( \Exception $e ) |
|
382 | + catch (\Exception $e) |
|
383 | 383 | { |
384 | - $dbm->release( $conn, $dbname ); |
|
384 | + $dbm->release($conn, $dbname); |
|
385 | 385 | throw $e; |
386 | 386 | } |
387 | 387 | |
388 | - return $this->buildItems( $map, $ref, 'customer' ); |
|
388 | + return $this->buildItems($map, $ref, 'customer'); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
397 | 397 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
398 | 398 | */ |
399 | - public function getSubManager( $manager, $name = null ) |
|
399 | + public function getSubManager($manager, $name = null) |
|
400 | 400 | { |
401 | - return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
401 | + return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Ezpublish' : $name)); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | |
@@ -410,15 +410,15 @@ discard block |
||
410 | 410 | * @param array $refItems Items referenced by the customer item via the list items |
411 | 411 | * @return \Aimeos\MShop\Customer\Item\Iface New customer item |
412 | 412 | */ |
413 | - protected function createItemBase( array $values = array(), array $listItems = array(), array $refItems = array() ) |
|
413 | + protected function createItemBase(array $values = array(), array $listItems = array(), array $refItems = array()) |
|
414 | 414 | { |
415 | - if( !isset( $this->addressManager ) ) { |
|
416 | - $this->addressManager = $this->getSubManager( 'address' ); |
|
415 | + if (!isset($this->addressManager)) { |
|
416 | + $this->addressManager = $this->getSubManager('address'); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | $helper = $this->getPasswordHelper(); |
420 | 420 | $address = $this->addressManager->createItem(); |
421 | 421 | |
422 | - return new \Aimeos\MShop\Customer\Item\Ezpublish( $address, $values, $listItems, $refItems, null, $helper ); |
|
422 | + return new \Aimeos\MShop\Customer\Item\Ezpublish($address, $values, $listItems, $refItems, null, $helper); |
|
423 | 423 | } |
424 | 424 | } |