@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function getPreDependencies() |
| 25 | 25 | { |
| 26 | - return array( 'TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData' ); |
|
| 26 | + return array('TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
@@ -33,22 +33,22 @@ discard block |
||
| 33 | 33 | public function migrate() |
| 34 | 34 | { |
| 35 | 35 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
| 36 | - if( !( $this->additional instanceof $iface ) ) { |
|
| 37 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
| 36 | + if (!($this->additional instanceof $iface)) { |
|
| 37 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $this->msg( 'Adding customer-property Laravel test data', 0 ); |
|
| 41 | - $this->additional->setEditor( 'ai-laravel:unittest' ); |
|
| 40 | + $this->msg('Adding customer-property Laravel test data', 0); |
|
| 41 | + $this->additional->setEditor('ai-laravel:unittest'); |
|
| 42 | 42 | |
| 43 | 43 | $ds = DIRECTORY_SEPARATOR; |
| 44 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php'; |
|
| 44 | + $path = __DIR__.$ds.'data'.$ds.'customer-property.php'; |
|
| 45 | 45 | |
| 46 | - if( ( $testdata = include( $path ) ) == false ) { |
|
| 47 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
| 46 | + if (($testdata = include($path)) == false) { |
|
| 47 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $this->addCustomerPropertyData( $testdata, 'Laravel' ); |
|
| 50 | + $this->addCustomerPropertyData($testdata, 'Laravel'); |
|
| 51 | 51 | |
| 52 | - $this->status( 'done' ); |
|
| 52 | + $this->status('done'); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -5,17 +5,17 @@ |
||
| 5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2017 |
| 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', 'longitude' => '10.0', 'latitude' => '50.0', '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', 'longitude' => '10.5', 'latitude' => '51.0', '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', 'longitude' => '11.0', 'latitude' => '52.0', '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', 'longitude' => '10.0', 'latitude' => '50.0', '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', 'longitude' => '10.5', 'latitude' => '51.0', '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', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
| 13 | 13 | ), |
| 14 | 14 | |
| 15 | 15 | 'customer/address' => array( |
| 16 | - 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', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0' ), |
|
| 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' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1' ), |
|
| 18 | - 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', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1' ), |
|
| 19 | - 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', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2' ), |
|
| 16 | + 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', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0'), |
|
| 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' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1'), |
|
| 18 | + 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', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1'), |
|
| 19 | + 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', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2'), |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
@@ -5,12 +5,12 @@ |
||
| 5 | 5 | * @copyright Aimeos (aimeos.org), 2018 |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -return array ( |
|
| 8 | +return array( |
|
| 9 | 9 | 'customer/property/type' => array( |
| 10 | - 'customer/property/type/newsletter' => array( 'domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1 ), |
|
| 10 | + 'customer/property/type/newsletter' => array('domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1), |
|
| 11 | 11 | ), |
| 12 | 12 | |
| 13 | 13 | 'customer/property' => array( |
| 14 | - 'customer/property/UTC001/newsletter' => array( 'parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1' ), |
|
| 14 | + 'customer/property/UTC001/newsletter' => array('parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1'), |
|
| 15 | 15 | ), |
| 16 | 16 | ); |
| 17 | 17 | \ No newline at end of file |
@@ -5,19 +5,19 @@ |
||
| 5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2017 |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -return array ( |
|
| 9 | - 'customer/lists/type' => array ( |
|
| 10 | - 'customer/group/default' => array( 'domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
| 11 | - 'order/download' => array( 'domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1 ), |
|
| 12 | - 'product/favorite' => array( 'domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1 ), |
|
| 13 | - 'product/watch' => array( 'domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1 ), |
|
| 14 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
| 8 | +return array( |
|
| 9 | + 'customer/lists/type' => array( |
|
| 10 | + 'customer/group/default' => array('domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
| 11 | + 'order/download' => array('domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1), |
|
| 12 | + 'product/favorite' => array('domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1), |
|
| 13 | + 'product/watch' => array('domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1), |
|
| 14 | + 'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
| 15 | 15 | ), |
| 16 | 16 | |
| 17 | - 'customer/lists' => array ( |
|
| 18 | - 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' => [], 'pos' => 1, 'status' => 1 ), |
|
| 19 | - 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' => [], 'pos' => 2, 'status' => 1 ), |
|
| 20 | - 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' => [], 'pos' => 3, 'status' => 1 ), |
|
| 21 | - 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' => [], 'pos' => 1, 'status' => 1 ), |
|
| 17 | + 'customer/lists' => array( |
|
| 18 | + 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' => [], 'pos' => 1, 'status' => 1), |
|
| 19 | + 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' => [], 'pos' => 2, 'status' => 1), |
|
| 20 | + 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' => [], 'pos' => 3, 'status' => 1), |
|
| 21 | + 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' => [], 'pos' => 1, 'status' => 1), |
|
| 22 | 22 | ), |
| 23 | 23 | ); |
| 24 | 24 | \ No newline at end of file |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | $context = \TestHelper::getContext(); |
| 21 | 21 | $this->editor = $context->getEditor(); |
| 22 | 22 | |
| 23 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Laravel' ); |
|
| 24 | - $this->object = $manager->getSubManager( 'property', 'Laravel' )->getSubManager( 'type', 'Laravel' ); |
|
| 23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Laravel'); |
|
| 24 | + $this->object = $manager->getSubManager('property', 'Laravel')->getSubManager('type', 'Laravel'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function testCleanup() |
| 35 | 35 | { |
| 36 | - $this->object->cleanup( array( -1 ) ); |
|
| 36 | + $this->object->cleanup(array( -1 )); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testCreateItem() |
| 41 | 41 | { |
| 42 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem() ); |
|
| 42 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem()); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | $result = $this->object->getResourceType(); |
| 49 | 49 | |
| 50 | - $this->assertContains( 'customer/property/type', $result ); |
|
| 50 | + $this->assertContains('customer/property/type', $result); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | public function testGetSearchAttributes() |
| 55 | 55 | { |
| 56 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
| 57 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
| 56 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
| 57 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -63,82 +63,82 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $search = $this->object->createSearch(); |
| 65 | 65 | $conditions = array( |
| 66 | - $search->compare( '==', 'customer.property.type.code', 'newsletter' ), |
|
| 67 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
| 66 | + $search->compare('==', 'customer.property.type.code', 'newsletter'), |
|
| 67 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
| 68 | 68 | ); |
| 69 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 69 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 70 | 70 | |
| 71 | - $results = $this->object->searchItems( $search ); |
|
| 71 | + $results = $this->object->searchItems($search); |
|
| 72 | 72 | |
| 73 | - if( ($expected = reset($results) ) === false ) |
|
| 73 | + if (($expected = reset($results)) === false) |
|
| 74 | 74 | { |
| 75 | - throw new \RuntimeException( 'No property type item found.' ); |
|
| 75 | + throw new \RuntimeException('No property type item found.'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $actual = $this->object->getItem( $expected->getId() ); |
|
| 78 | + $actual = $this->object->getItem($expected->getId()); |
|
| 79 | 79 | |
| 80 | - $this->assertEquals( $expected, $actual ); |
|
| 80 | + $this->assertEquals($expected, $actual); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | public function testSaveInvalid() |
| 85 | 85 | { |
| 86 | - $this->setExpectedException( '\Aimeos\MShop\Exception' ); |
|
| 87 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
| 86 | + $this->setExpectedException('\Aimeos\MShop\Exception'); |
|
| 87 | + $this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard()); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | public function testSaveUpdateDeleteItem() |
| 92 | 92 | { |
| 93 | 93 | $search = $this->object->createSearch(); |
| 94 | - $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
|
| 94 | + $search->setConditions($search->compare('==', 'customer.property.type.editor', $this->editor)); |
|
| 95 | 95 | $results = $this->object->searchItems($search); |
| 96 | 96 | |
| 97 | - if( ( $item = reset($results) ) === false ) { |
|
| 98 | - throw new \RuntimeException( 'No type item found' ); |
|
| 97 | + if (($item = reset($results)) === false) { |
|
| 98 | + throw new \RuntimeException('No type item found'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $item->setId(null); |
| 102 | - $item->setCode( 'unitTestSave' ); |
|
| 103 | - $resultSaved = $this->object->saveItem( $item ); |
|
| 104 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
| 102 | + $item->setCode('unitTestSave'); |
|
| 103 | + $resultSaved = $this->object->saveItem($item); |
|
| 104 | + $itemSaved = $this->object->getItem($item->getId()); |
|
| 105 | 105 | |
| 106 | 106 | $itemExp = clone $itemSaved; |
| 107 | - $itemExp->setCode( 'unitTestSave2' ); |
|
| 108 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
| 109 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
| 107 | + $itemExp->setCode('unitTestSave2'); |
|
| 108 | + $resultUpd = $this->object->saveItem($itemExp); |
|
| 109 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
| 110 | 110 | |
| 111 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
| 111 | + $this->object->deleteItem($itemSaved->getId()); |
|
| 112 | 112 | |
| 113 | 113 | |
| 114 | - $this->assertTrue( $item->getId() !== null ); |
|
| 115 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
| 116 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
| 117 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
| 118 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
| 119 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
| 120 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
| 114 | + $this->assertTrue($item->getId() !== null); |
|
| 115 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
| 116 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
| 117 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
| 118 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
| 119 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
| 120 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
| 121 | 121 | |
| 122 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
| 123 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
| 124 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 122 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
| 123 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
| 124 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
| 125 | 125 | |
| 126 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
| 127 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
| 128 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
| 129 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
| 130 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
| 131 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
| 126 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
| 127 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
| 128 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
| 129 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
| 130 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
| 131 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
| 132 | 132 | |
| 133 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
| 134 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
| 135 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
| 133 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
| 134 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
| 135 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
| 136 | 136 | |
| 137 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
| 138 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
| 137 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
| 138 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
| 139 | 139 | |
| 140 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 141 | - $this->object->getItem( $itemSaved->getId() ); |
|
| 140 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 141 | + $this->object->getItem($itemSaved->getId()); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
@@ -148,36 +148,36 @@ discard block |
||
| 148 | 148 | $search = $this->object->createSearch(); |
| 149 | 149 | |
| 150 | 150 | $expr = []; |
| 151 | - $expr[] = $search->compare( '!=', 'customer.property.type.id', null ); |
|
| 152 | - $expr[] = $search->compare( '!=', 'customer.property.type.siteid', null ); |
|
| 153 | - $expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' ); |
|
| 154 | - $expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' ); |
|
| 155 | - $expr[] = $search->compare( '>', 'customer.property.type.label', '' ); |
|
| 156 | - $expr[] = $search->compare( '>=', 'customer.property.type.position', 0 ); |
|
| 157 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
| 158 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
| 159 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
| 160 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
| 161 | - |
|
| 162 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
| 163 | - $results = $this->object->searchItems( $search, [], $total ); |
|
| 164 | - $this->assertEquals( 1, count( $results ) ); |
|
| 151 | + $expr[] = $search->compare('!=', 'customer.property.type.id', null); |
|
| 152 | + $expr[] = $search->compare('!=', 'customer.property.type.siteid', null); |
|
| 153 | + $expr[] = $search->compare('==', 'customer.property.type.domain', 'customer'); |
|
| 154 | + $expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter'); |
|
| 155 | + $expr[] = $search->compare('>', 'customer.property.type.label', ''); |
|
| 156 | + $expr[] = $search->compare('>=', 'customer.property.type.position', 0); |
|
| 157 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
| 158 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
| 159 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
| 160 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
| 161 | + |
|
| 162 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 163 | + $results = $this->object->searchItems($search, [], $total); |
|
| 164 | + $this->assertEquals(1, count($results)); |
|
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | $search = $this->object->createSearch(); |
| 168 | 168 | $conditions = array( |
| 169 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
| 170 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
| 169 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
| 170 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
| 171 | 171 | ); |
| 172 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
| 172 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 173 | 173 | $search->setSlice(0, 1); |
| 174 | - $items = $this->object->searchItems( $search, [], $total); |
|
| 174 | + $items = $this->object->searchItems($search, [], $total); |
|
| 175 | 175 | |
| 176 | - $this->assertEquals( 1, count( $items ) ); |
|
| 177 | - $this->assertEquals( 1, $total ); |
|
| 176 | + $this->assertEquals(1, count($items)); |
|
| 177 | + $this->assertEquals(1, $total); |
|
| 178 | 178 | |
| 179 | - foreach($items as $itemId => $item) { |
|
| 180 | - $this->assertEquals( $itemId, $item->getId() ); |
|
| 179 | + foreach ($items as $itemId => $item) { |
|
| 180 | + $this->assertEquals($itemId, $item->getId()); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -16,29 +16,29 @@ discard block |
||
| 16 | 16 | protected function setUp() |
| 17 | 17 | { |
| 18 | 18 | $this->editor = \TestHelper::getContext()->getEditor(); |
| 19 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Laravel' ); |
|
| 19 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Laravel'); |
|
| 20 | 20 | |
| 21 | - $listManager = $manager->getSubManager( 'lists', 'Laravel' ); |
|
| 22 | - $this->object = $listManager->getSubManager( 'type', 'Laravel' ); |
|
| 21 | + $listManager = $manager->getSubManager('lists', 'Laravel'); |
|
| 22 | + $this->object = $listManager->getSubManager('type', 'Laravel'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - unset( $this->object ); |
|
| 28 | + unset($this->object); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | public function testCleanup() |
| 33 | 33 | { |
| 34 | - $this->object->cleanup( array( -1 ) ); |
|
| 34 | + $this->object->cleanup(array( -1 )); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateItem() |
| 39 | 39 | { |
| 40 | 40 | $item = $this->object->createItem(); |
| 41 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
| 41 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | $search->setSlice(0, 1); |
| 49 | 49 | $results = $this->object->searchItems($search); |
| 50 | 50 | |
| 51 | - if( ( $expected = reset($results) ) === false ) { |
|
| 52 | - throw new \RuntimeException( 'No list type item found' ); |
|
| 51 | + if (($expected = reset($results)) === false) { |
|
| 52 | + throw new \RuntimeException('No list type item found'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
| 55 | + $this->assertEquals($expected, $this->object->getItem($expected->getId())); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | public function testGetSubManager() |
| 60 | 60 | { |
| 61 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 62 | - $this->object->getSubManager( 'unknown' ); |
|
| 61 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 62 | + $this->object->getSubManager('unknown'); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -69,51 +69,51 @@ discard block |
||
| 69 | 69 | $search->setSlice(0, 1); |
| 70 | 70 | $results = $this->object->searchItems($search); |
| 71 | 71 | |
| 72 | - if( ( $item = reset($results) ) === false ) { |
|
| 73 | - throw new \RuntimeException( 'No type item found' ); |
|
| 72 | + if (($item = reset($results)) === false) { |
|
| 73 | + throw new \RuntimeException('No type item found'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $item->setId(null); |
| 77 | - $item->setCode( 'unitTestInit' ); |
|
| 78 | - $resultSaved = $this->object->saveItem( $item ); |
|
| 79 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
| 77 | + $item->setCode('unitTestInit'); |
|
| 78 | + $resultSaved = $this->object->saveItem($item); |
|
| 79 | + $itemSaved = $this->object->getItem($item->getId()); |
|
| 80 | 80 | |
| 81 | 81 | $itemExp = clone $itemSaved; |
| 82 | - $itemExp->setCode( 'unitTestSave' ); |
|
| 83 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
| 84 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
| 82 | + $itemExp->setCode('unitTestSave'); |
|
| 83 | + $resultUpd = $this->object->saveItem($itemExp); |
|
| 84 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
| 85 | 85 | |
| 86 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
| 86 | + $this->object->deleteItem($itemSaved->getId()); |
|
| 87 | 87 | |
| 88 | 88 | |
| 89 | - $this->assertTrue( $item->getId() !== null ); |
|
| 90 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
| 91 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
| 92 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
| 93 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
| 94 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
| 95 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
| 89 | + $this->assertTrue($item->getId() !== null); |
|
| 90 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
| 91 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
| 92 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
| 93 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
| 94 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
| 95 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
| 96 | 96 | |
| 97 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
| 98 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
| 99 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 97 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
| 98 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
| 99 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
| 100 | 100 | |
| 101 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
| 102 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
| 103 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
| 104 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
| 105 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
| 106 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
| 101 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
| 102 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
| 103 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
| 104 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
| 105 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
| 106 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
| 107 | 107 | |
| 108 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
| 109 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
| 110 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
| 108 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
| 109 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
| 110 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
| 111 | 111 | |
| 112 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
| 113 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
| 112 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
| 113 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
| 114 | 114 | |
| 115 | 115 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
| 116 | - $this->object->getItem( $itemSaved->getId() ); |
|
| 116 | + $this->object->getItem($itemSaved->getId()); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -123,26 +123,26 @@ discard block |
||
| 123 | 123 | $search = $this->object->createSearch(); |
| 124 | 124 | |
| 125 | 125 | $expr = []; |
| 126 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
| 127 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
| 128 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
| 129 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
| 130 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
| 131 | - $expr[] = $search->compare( '>=', 'customer.lists.type.position', 0 ); |
|
| 132 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
| 133 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
| 134 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
| 135 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
| 136 | - |
|
| 137 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 126 | + $expr[] = $search->compare('!=', 'customer.lists.type.id', 0); |
|
| 127 | + $expr[] = $search->compare('!=', 'customer.lists.type.siteid', null); |
|
| 128 | + $expr[] = $search->compare('==', 'customer.lists.type.code', 'default'); |
|
| 129 | + $expr[] = $search->compare('==', 'customer.lists.type.domain', 'text'); |
|
| 130 | + $expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard'); |
|
| 131 | + $expr[] = $search->compare('>=', 'customer.lists.type.position', 0); |
|
| 132 | + $expr[] = $search->compare('==', 'customer.lists.type.status', 1); |
|
| 133 | + $expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00'); |
|
| 134 | + $expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00'); |
|
| 135 | + $expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor); |
|
| 136 | + |
|
| 137 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 138 | 138 | $search->setSlice(0, 1); |
| 139 | 139 | |
| 140 | - $results = $this->object->searchItems( $search, [], $total ); |
|
| 141 | - $this->assertEquals( 1, count( $results ) ); |
|
| 142 | - $this->assertEquals( 1, $total ); |
|
| 140 | + $results = $this->object->searchItems($search, [], $total); |
|
| 141 | + $this->assertEquals(1, count($results)); |
|
| 142 | + $this->assertEquals(1, $total); |
|
| 143 | 143 | |
| 144 | - foreach($results as $itemId => $item) { |
|
| 145 | - $this->assertEquals( $itemId, $item->getId() ); |
|
| 144 | + foreach ($results as $itemId => $item) { |
|
| 145 | + $this->assertEquals($itemId, $item->getId()); |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -21,41 +21,41 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $context = \TestHelper::getContext(); |
| 23 | 23 | $this->editor = $context->getEditor(); |
| 24 | - $this->object = new \Aimeos\MShop\Customer\Manager\Laravel( $context ); |
|
| 24 | + $this->object = new \Aimeos\MShop\Customer\Manager\Laravel($context); |
|
| 25 | 25 | |
| 26 | 26 | $this->fixture = array( |
| 27 | 27 | 'label' => 'unitTest', |
| 28 | 28 | 'status' => 2, |
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | - $this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' ); |
|
| 31 | + $this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | protected function tearDown() |
| 36 | 36 | { |
| 37 | - unset( $this->object, $this->fixture, $this->address ); |
|
| 37 | + unset($this->object, $this->fixture, $this->address); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | public function testCleanup() |
| 42 | 42 | { |
| 43 | - $this->object->cleanup( array( -1 ) ); |
|
| 43 | + $this->object->cleanup(array( -1 )); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | public function testGetSearchAttributes() |
| 48 | 48 | { |
| 49 | - foreach( $this->object->getSearchAttributes() as $attribute ) |
|
| 49 | + foreach ($this->object->getSearchAttributes() as $attribute) |
|
| 50 | 50 | { |
| 51 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
| 51 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public function testCreateItem() |
| 57 | 57 | { |
| 58 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() ); |
|
| 58 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem()); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
@@ -63,21 +63,21 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $search = $this->object->createSearch(); |
| 65 | 65 | $conditions = array( |
| 66 | - $search->compare( '==', 'customer.code', 'UTC003' ), |
|
| 67 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
| 66 | + $search->compare('==', 'customer.code', 'UTC003'), |
|
| 67 | + $search->compare('==', 'customer.editor', $this->editor) |
|
| 68 | 68 | ); |
| 69 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 70 | - $items = $this->object->searchItems( $search, array( 'text' ) ); |
|
| 69 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 70 | + $items = $this->object->searchItems($search, array('text')); |
|
| 71 | 71 | |
| 72 | - if( ( $expected = reset( $items ) ) === false ) { |
|
| 73 | - throw new \RuntimeException( 'No customer item with code "UTC003" found' ); |
|
| 72 | + if (($expected = reset($items)) === false) { |
|
| 73 | + throw new \RuntimeException('No customer item with code "UTC003" found'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $actual = $this->object->getItem( $expected->getId(), array( 'text' ) ); |
|
| 76 | + $actual = $this->object->getItem($expected->getId(), array('text')); |
|
| 77 | 77 | |
| 78 | - $this->assertEquals( $expected, $actual ); |
|
| 79 | - $this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) ); |
|
| 80 | - $this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) ); |
|
| 78 | + $this->assertEquals($expected, $actual); |
|
| 79 | + $this->assertEquals(3, count($actual->getListItems('text'))); |
|
| 80 | + $this->assertEquals(3, count($actual->getRefItems('text'))); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -85,92 +85,92 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $item = $this->object->createItem(); |
| 87 | 87 | |
| 88 | - $item->setCode( 'unitTest' ); |
|
| 89 | - $item->setLabel( 'unitTest' ); |
|
| 90 | - $resultSaved = $this->object->saveItem( $item ); |
|
| 91 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
| 88 | + $item->setCode('unitTest'); |
|
| 89 | + $item->setLabel('unitTest'); |
|
| 90 | + $resultSaved = $this->object->saveItem($item); |
|
| 91 | + $itemSaved = $this->object->getItem($item->getId()); |
|
| 92 | 92 | |
| 93 | 93 | $itemExp = clone $itemSaved; |
| 94 | - $itemExp->setCode( 'unitTest2' ); |
|
| 95 | - $itemExp->setLabel( 'unitTest2' ); |
|
| 96 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
| 97 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
| 98 | - |
|
| 99 | - $this->object->deleteItem( $item->getId() ); |
|
| 100 | - |
|
| 101 | - $this->assertTrue( $item->getId() !== null ); |
|
| 102 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
| 103 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
| 104 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
| 105 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
| 106 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
| 107 | - $this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() ); |
|
| 108 | - $this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() ); |
|
| 109 | - $this->assertEquals( $item->getPassword(), $itemSaved->getPassword() ); |
|
| 110 | - |
|
| 111 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
| 112 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
| 113 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 114 | - |
|
| 115 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
| 116 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
| 117 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
| 118 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
| 119 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
| 120 | - $this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() ); |
|
| 121 | - $this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() ); |
|
| 122 | - $this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() ); |
|
| 123 | - |
|
| 124 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
| 125 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
| 126 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
| 127 | - |
|
| 128 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
| 129 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
| 130 | - |
|
| 131 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 132 | - $this->object->getItem( $item->getId() ); |
|
| 94 | + $itemExp->setCode('unitTest2'); |
|
| 95 | + $itemExp->setLabel('unitTest2'); |
|
| 96 | + $resultUpd = $this->object->saveItem($itemExp); |
|
| 97 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
| 98 | + |
|
| 99 | + $this->object->deleteItem($item->getId()); |
|
| 100 | + |
|
| 101 | + $this->assertTrue($item->getId() !== null); |
|
| 102 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
| 103 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
| 104 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
| 105 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
| 106 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
| 107 | + $this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress()); |
|
| 108 | + $this->assertEquals($item->getBirthday(), $itemSaved->getBirthday()); |
|
| 109 | + $this->assertEquals($item->getPassword(), $itemSaved->getPassword()); |
|
| 110 | + |
|
| 111 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
| 112 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
| 113 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
| 114 | + |
|
| 115 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
| 116 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
| 117 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
| 118 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
| 119 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
| 120 | + $this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress()); |
|
| 121 | + $this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday()); |
|
| 122 | + $this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword()); |
|
| 123 | + |
|
| 124 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
| 125 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
| 126 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
| 127 | + |
|
| 128 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
| 129 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
| 130 | + |
|
| 131 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 132 | + $this->object->getItem($item->getId()); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | public function testGetSaveAddressItems() |
| 137 | 137 | { |
| 138 | - $item = $this->object->findItem( 'UTC001', ['customer/address'] ); |
|
| 138 | + $item = $this->object->findItem('UTC001', ['customer/address']); |
|
| 139 | 139 | |
| 140 | - $item->setId( null )->setCode( 'xyz' ); |
|
| 141 | - $item->getPaymentAddress()->setEmail( '[email protected]' ); |
|
| 142 | - $item->addAddressItem( new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.' ) ); |
|
| 143 | - $this->object->saveItem( $item ); |
|
| 140 | + $item->setId(null)->setCode('xyz'); |
|
| 141 | + $item->getPaymentAddress()->setEmail('[email protected]'); |
|
| 142 | + $item->addAddressItem(new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.')); |
|
| 143 | + $this->object->saveItem($item); |
|
| 144 | 144 | |
| 145 | - $item2 = $this->object->findItem( 'xyz', ['customer/address'] ); |
|
| 145 | + $item2 = $this->object->findItem('xyz', ['customer/address']); |
|
| 146 | 146 | |
| 147 | - $this->object->deleteItem( $item->getId() ); |
|
| 147 | + $this->object->deleteItem($item->getId()); |
|
| 148 | 148 | |
| 149 | - $this->assertEquals( 2, count( $item->getAddressItems() ) ); |
|
| 150 | - $this->assertEquals( 2, count( $item2->getAddressItems() ) ); |
|
| 149 | + $this->assertEquals(2, count($item->getAddressItems())); |
|
| 150 | + $this->assertEquals(2, count($item2->getAddressItems())); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | public function testGetSavePropertyItems() |
| 155 | 155 | { |
| 156 | - $item = $this->object->findItem( 'UTC001', ['customer/property'] ); |
|
| 156 | + $item = $this->object->findItem('UTC001', ['customer/property']); |
|
| 157 | 157 | |
| 158 | - $item->setId( null )->setCode( 'xyz' ); |
|
| 159 | - $item->getPaymentAddress()->setEmail( '[email protected]' ); |
|
| 160 | - $this->object->saveItem( $item ); |
|
| 158 | + $item->setId(null)->setCode('xyz'); |
|
| 159 | + $item->getPaymentAddress()->setEmail('[email protected]'); |
|
| 160 | + $this->object->saveItem($item); |
|
| 161 | 161 | |
| 162 | - $item2 = $this->object->findItem( 'xyz', ['customer/property'] ); |
|
| 162 | + $item2 = $this->object->findItem('xyz', ['customer/property']); |
|
| 163 | 163 | |
| 164 | - $this->object->deleteItem( $item->getId() ); |
|
| 164 | + $this->object->deleteItem($item->getId()); |
|
| 165 | 165 | |
| 166 | - $this->assertEquals( 1, count( $item->getPropertyItems() ) ); |
|
| 167 | - $this->assertEquals( 1, count( $item2->getPropertyItems() ) ); |
|
| 166 | + $this->assertEquals(1, count($item->getPropertyItems())); |
|
| 167 | + $this->assertEquals(1, count($item2->getPropertyItems())); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | public function testCreateSearch() |
| 172 | 172 | { |
| 173 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
| 173 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -180,69 +180,69 @@ discard block |
||
| 180 | 180 | $search = $this->object->createSearch(); |
| 181 | 181 | |
| 182 | 182 | $expr = []; |
| 183 | - $expr[] = $search->compare( '!=', 'customer.id', null ); |
|
| 184 | - $expr[] = $search->compare( '==', 'customer.label', 'unitCustomer2' ); |
|
| 185 | - $expr[] = $search->compare( '==', 'customer.code', 'UTC002' ); |
|
| 186 | - |
|
| 187 | - $expr[] = $search->compare( '>=', 'customer.salutation', '' ); |
|
| 188 | - $expr[] = $search->compare( '>=', 'customer.company', '' ); |
|
| 189 | - $expr[] = $search->compare( '>=', 'customer.vatid', '' ); |
|
| 190 | - $expr[] = $search->compare( '>=', 'customer.title', '' ); |
|
| 191 | - $expr[] = $search->compare( '>=', 'customer.firstname', '' ); |
|
| 192 | - $expr[] = $search->compare( '>=', 'customer.lastname', '' ); |
|
| 193 | - $expr[] = $search->compare( '>=', 'customer.address1', '' ); |
|
| 194 | - $expr[] = $search->compare( '>=', 'customer.address2', '' ); |
|
| 195 | - $expr[] = $search->compare( '>=', 'customer.address3', '' ); |
|
| 196 | - $expr[] = $search->compare( '>=', 'customer.postal', '' ); |
|
| 197 | - $expr[] = $search->compare( '>=', 'customer.city', '' ); |
|
| 198 | - $expr[] = $search->compare( '>=', 'customer.state', '' ); |
|
| 199 | - $expr[] = $search->compare( '!=', 'customer.languageid', null ); |
|
| 200 | - $expr[] = $search->compare( '>=', 'customer.countryid', '' ); |
|
| 201 | - $expr[] = $search->compare( '>=', 'customer.telephone', '' ); |
|
| 202 | - $expr[] = $search->compare( '>=', 'customer.email', '' ); |
|
| 203 | - $expr[] = $search->compare( '>=', 'customer.telefax', '' ); |
|
| 204 | - $expr[] = $search->compare( '>=', 'customer.website', '' ); |
|
| 205 | - $expr[] = $search->compare( '>=', 'customer.longitude', '10.0' ); |
|
| 206 | - $expr[] = $search->compare( '>=', 'customer.latitude', '50.0' ); |
|
| 207 | - |
|
| 208 | - $expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' ); |
|
| 209 | - $expr[] = $search->compare( '>=', 'customer.password', '' ); |
|
| 210 | - $expr[] = $search->compare( '==', 'customer.status', 0 ); |
|
| 211 | - $expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' ); |
|
| 212 | - $expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' ); |
|
| 213 | - $expr[] = $search->compare( '==', 'customer.editor', $this->editor ); |
|
| 214 | - |
|
| 215 | - $expr[] = $search->compare( '!=', 'customer.address.id', null ); |
|
| 216 | - $expr[] = $search->compare( '!=', 'customer.address.parentid', null ); |
|
| 217 | - $expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' ); |
|
| 218 | - $expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' ); |
|
| 219 | - $expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' ); |
|
| 220 | - $expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' ); |
|
| 221 | - $expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' ); |
|
| 222 | - $expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' ); |
|
| 223 | - $expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' ); |
|
| 224 | - $expr[] = $search->compare( '==', 'customer.address.address2', '2-4' ); |
|
| 225 | - $expr[] = $search->compare( '==', 'customer.address.address3', '' ); |
|
| 226 | - $expr[] = $search->compare( '==', 'customer.address.postal', '11099' ); |
|
| 227 | - $expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' ); |
|
| 228 | - $expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' ); |
|
| 229 | - $expr[] = $search->compare( '==', 'customer.address.languageid', 'de' ); |
|
| 230 | - $expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' ); |
|
| 231 | - $expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' ); |
|
| 232 | - $expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' ); |
|
| 233 | - $expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' ); |
|
| 234 | - $expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' ); |
|
| 235 | - $expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' ); |
|
| 236 | - $expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' ); |
|
| 237 | - $expr[] = $search->compare( '==', 'customer.address.flag', 0 ); |
|
| 238 | - $expr[] = $search->compare( '==', 'customer.address.position', 1 ); |
|
| 239 | - $expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' ); |
|
| 240 | - $expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' ); |
|
| 241 | - $expr[] = $search->compare( '==', 'customer.address.editor', $this->editor ); |
|
| 242 | - |
|
| 243 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 244 | - $result = $this->object->searchItems( $search, [], $total ); |
|
| 245 | - $this->assertEquals( 1, count( $result ) ); |
|
| 183 | + $expr[] = $search->compare('!=', 'customer.id', null); |
|
| 184 | + $expr[] = $search->compare('==', 'customer.label', 'unitCustomer2'); |
|
| 185 | + $expr[] = $search->compare('==', 'customer.code', 'UTC002'); |
|
| 186 | + |
|
| 187 | + $expr[] = $search->compare('>=', 'customer.salutation', ''); |
|
| 188 | + $expr[] = $search->compare('>=', 'customer.company', ''); |
|
| 189 | + $expr[] = $search->compare('>=', 'customer.vatid', ''); |
|
| 190 | + $expr[] = $search->compare('>=', 'customer.title', ''); |
|
| 191 | + $expr[] = $search->compare('>=', 'customer.firstname', ''); |
|
| 192 | + $expr[] = $search->compare('>=', 'customer.lastname', ''); |
|
| 193 | + $expr[] = $search->compare('>=', 'customer.address1', ''); |
|
| 194 | + $expr[] = $search->compare('>=', 'customer.address2', ''); |
|
| 195 | + $expr[] = $search->compare('>=', 'customer.address3', ''); |
|
| 196 | + $expr[] = $search->compare('>=', 'customer.postal', ''); |
|
| 197 | + $expr[] = $search->compare('>=', 'customer.city', ''); |
|
| 198 | + $expr[] = $search->compare('>=', 'customer.state', ''); |
|
| 199 | + $expr[] = $search->compare('!=', 'customer.languageid', null); |
|
| 200 | + $expr[] = $search->compare('>=', 'customer.countryid', ''); |
|
| 201 | + $expr[] = $search->compare('>=', 'customer.telephone', ''); |
|
| 202 | + $expr[] = $search->compare('>=', 'customer.email', ''); |
|
| 203 | + $expr[] = $search->compare('>=', 'customer.telefax', ''); |
|
| 204 | + $expr[] = $search->compare('>=', 'customer.website', ''); |
|
| 205 | + $expr[] = $search->compare('>=', 'customer.longitude', '10.0'); |
|
| 206 | + $expr[] = $search->compare('>=', 'customer.latitude', '50.0'); |
|
| 207 | + |
|
| 208 | + $expr[] = $search->compare('==', 'customer.birthday', '1970-01-01'); |
|
| 209 | + $expr[] = $search->compare('>=', 'customer.password', ''); |
|
| 210 | + $expr[] = $search->compare('==', 'customer.status', 0); |
|
| 211 | + $expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00'); |
|
| 212 | + $expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00'); |
|
| 213 | + $expr[] = $search->compare('==', 'customer.editor', $this->editor); |
|
| 214 | + |
|
| 215 | + $expr[] = $search->compare('!=', 'customer.address.id', null); |
|
| 216 | + $expr[] = $search->compare('!=', 'customer.address.parentid', null); |
|
| 217 | + $expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH'); |
|
| 218 | + $expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999'); |
|
| 219 | + $expr[] = $search->compare('==', 'customer.address.salutation', 'mr'); |
|
| 220 | + $expr[] = $search->compare('==', 'customer.address.title', 'Dr.'); |
|
| 221 | + $expr[] = $search->compare('==', 'customer.address.firstname', 'Good'); |
|
| 222 | + $expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest'); |
|
| 223 | + $expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben'); |
|
| 224 | + $expr[] = $search->compare('==', 'customer.address.address2', '2-4'); |
|
| 225 | + $expr[] = $search->compare('==', 'customer.address.address3', ''); |
|
| 226 | + $expr[] = $search->compare('==', 'customer.address.postal', '11099'); |
|
| 227 | + $expr[] = $search->compare('==', 'customer.address.city', 'Berlin'); |
|
| 228 | + $expr[] = $search->compare('==', 'customer.address.state', 'Berlin'); |
|
| 229 | + $expr[] = $search->compare('==', 'customer.address.languageid', 'de'); |
|
| 230 | + $expr[] = $search->compare('==', 'customer.address.countryid', 'DE'); |
|
| 231 | + $expr[] = $search->compare('==', 'customer.address.telephone', '055544332221'); |
|
| 232 | + $expr[] = $search->compare('==', 'customer.address.email', '[email protected]'); |
|
| 233 | + $expr[] = $search->compare('==', 'customer.address.telefax', '055544333212'); |
|
| 234 | + $expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org'); |
|
| 235 | + $expr[] = $search->compare('>=', 'customer.address.longitude', '10.0'); |
|
| 236 | + $expr[] = $search->compare('>=', 'customer.address.latitude', '50.0'); |
|
| 237 | + $expr[] = $search->compare('==', 'customer.address.flag', 0); |
|
| 238 | + $expr[] = $search->compare('==', 'customer.address.position', 1); |
|
| 239 | + $expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00'); |
|
| 240 | + $expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00'); |
|
| 241 | + $expr[] = $search->compare('==', 'customer.address.editor', $this->editor); |
|
| 242 | + |
|
| 243 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 244 | + $result = $this->object->searchItems($search, [], $total); |
|
| 245 | + $this->assertEquals(1, count($result)); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -251,60 +251,60 @@ discard block |
||
| 251 | 251 | $total = 0; |
| 252 | 252 | |
| 253 | 253 | $search = $this->object->createSearch(); |
| 254 | - $search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) ); |
|
| 255 | - $search->setSlice( 0, 2 ); |
|
| 254 | + $search->setConditions($search->compare('==', 'customer.address.editor', $this->editor)); |
|
| 255 | + $search->setSlice(0, 2); |
|
| 256 | 256 | |
| 257 | - $results = $this->object->searchItems( $search, [], $total ); |
|
| 258 | - $this->assertEquals( 2, count( $results ) ); |
|
| 259 | - $this->assertEquals( 3, $total ); |
|
| 257 | + $results = $this->object->searchItems($search, [], $total); |
|
| 258 | + $this->assertEquals(2, count($results)); |
|
| 259 | + $this->assertEquals(3, $total); |
|
| 260 | 260 | |
| 261 | - foreach($results as $itemId => $item) { |
|
| 262 | - $this->assertEquals( $itemId, $item->getId() ); |
|
| 261 | + foreach ($results as $itemId => $item) { |
|
| 262 | + $this->assertEquals($itemId, $item->getId()); |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| 267 | 267 | public function testSearchItemsCriteria() |
| 268 | 268 | { |
| 269 | - $search = $this->object->createSearch( true ); |
|
| 269 | + $search = $this->object->createSearch(true); |
|
| 270 | 270 | $conditions = array( |
| 271 | - $search->compare( '==', 'customer.address.editor', $this->editor ), |
|
| 271 | + $search->compare('==', 'customer.address.editor', $this->editor), |
|
| 272 | 272 | $search->getConditions() |
| 273 | 273 | ); |
| 274 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 275 | - $this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) ); |
|
| 274 | + $search->setConditions($search->combine('&&', $conditions)); |
|
| 275 | + $this->assertEquals(2, count($this->object->searchItems($search, [], $total))); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| 279 | 279 | public function testSearchItemsRef() |
| 280 | 280 | { |
| 281 | 281 | $search = $this->object->createSearch(); |
| 282 | - $search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) ); |
|
| 282 | + $search->setConditions($search->compare('==', 'customer.code', 'UTC001')); |
|
| 283 | 283 | |
| 284 | - $results = $this->object->searchItems( $search, ['customer/address', 'text'] ); |
|
| 284 | + $results = $this->object->searchItems($search, ['customer/address', 'text']); |
|
| 285 | 285 | |
| 286 | - if( ( $item = reset( $results ) ) === false ) { |
|
| 287 | - throw new \Exception( 'No customer item for "UTC001" available' ); |
|
| 286 | + if (($item = reset($results)) === false) { |
|
| 287 | + throw new \Exception('No customer item for "UTC001" available'); |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - $this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) ); |
|
| 291 | - $this->assertEquals( 1, count( $item->getAddressItems() ) ); |
|
| 290 | + $this->assertEquals(1, count($item->getRefItems('text'))); |
|
| 291 | + $this->assertEquals(1, count($item->getAddressItems())); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | public function testGetSubManager() |
| 296 | 296 | { |
| 297 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) ); |
|
| 298 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) ); |
|
| 297 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address')); |
|
| 298 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard')); |
|
| 299 | 299 | |
| 300 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 301 | - $this->object->getSubManager( 'unknown' ); |
|
| 300 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 301 | + $this->object->getSubManager('unknown'); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| 305 | 305 | public function testGetSubManagerInvalidName() |
| 306 | 306 | { |
| 307 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 308 | - $this->object->getSubManager( 'address', 'unknown' ); |
|
| 307 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 308 | + $this->object->getSubManager('address', 'unknown'); |
|
| 309 | 309 | } |
| 310 | 310 | } |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | * |
| 242 | 242 | * @param array $siteids List of IDs for sites whose entries should be deleted |
| 243 | 243 | */ |
| 244 | - public function cleanup( array $siteids ) |
|
| 244 | + public function cleanup(array $siteids) |
|
| 245 | 245 | { |
| 246 | 246 | $path = 'mshop/customer/manager/submanagers'; |
| 247 | 247 | $default = ['address', 'group', 'lists', 'property']; |
| 248 | 248 | |
| 249 | - foreach( $this->getContext()->getConfig()->get( $path, $default ) as $domain ) { |
|
| 250 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
| 249 | + foreach ($this->getContext()->getConfig()->get($path, $default) as $domain) { |
|
| 250 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | */ |
| 260 | 260 | public function createItem() |
| 261 | 261 | { |
| 262 | - return $this->createItemBase( ['customer.siteid' => $this->getContext()->getLocale()->getSiteId()] ); |
|
| 262 | + return $this->createItemBase(['customer.siteid' => $this->getContext()->getLocale()->getSiteId()]); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | * |
| 269 | 269 | * @param array $ids List of IDs |
| 270 | 270 | */ |
| 271 | - public function deleteItems( array $ids ) |
|
| 271 | + public function deleteItems(array $ids) |
|
| 272 | 272 | { |
| 273 | 273 | $path = 'mshop/customer/manager/laravel/delete'; |
| 274 | - $this->deleteItemsBase( $ids, $path, false ); |
|
| 274 | + $this->deleteItemsBase($ids, $path, false); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -281,12 +281,12 @@ discard block |
||
| 281 | 281 | * @param boolean $withsub Return also attributes of sub-managers if true |
| 282 | 282 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 283 | 283 | */ |
| 284 | - public function getSearchAttributes( $withsub = true ) |
|
| 284 | + public function getSearchAttributes($withsub = true) |
|
| 285 | 285 | { |
| 286 | 286 | $path = 'mshop/customer/manager/submanagers'; |
| 287 | 287 | $default = ['address', 'group', 'lists', 'property']; |
| 288 | 288 | |
| 289 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, $default, $withsub ); |
|
| 289 | + return $this->getSearchAttributesBase($this->searchConfig, $path, $default, $withsub); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
@@ -297,32 +297,32 @@ discard block |
||
| 297 | 297 | * @param boolean $fetch True if the new ID should be returned in the item |
| 298 | 298 | * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
| 299 | 299 | */ |
| 300 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
| 300 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
| 301 | 301 | { |
| 302 | 302 | $iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface'; |
| 303 | - if( !( $item instanceof $iface ) ) { |
|
| 304 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
| 303 | + if (!($item instanceof $iface)) { |
|
| 304 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - if( !$item->isModified() ) |
|
| 307 | + if (!$item->isModified()) |
|
| 308 | 308 | { |
| 309 | - $item = $this->savePropertyItems( $item, 'customer' ); |
|
| 310 | - $item = $this->saveAddressItems( $item, 'customer' ); |
|
| 311 | - return $this->saveRefItems( $item, 'customer' ); |
|
| 309 | + $item = $this->savePropertyItems($item, 'customer'); |
|
| 310 | + $item = $this->saveAddressItems($item, 'customer'); |
|
| 311 | + return $this->saveRefItems($item, 'customer'); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | $context = $this->getContext(); |
| 315 | 315 | $dbm = $context->getDatabaseManager(); |
| 316 | 316 | $dbname = $this->getResourceName(); |
| 317 | - $conn = $dbm->acquire( $dbname ); |
|
| 317 | + $conn = $dbm->acquire($dbname); |
|
| 318 | 318 | |
| 319 | 319 | try |
| 320 | 320 | { |
| 321 | 321 | $id = $item->getId(); |
| 322 | - $date = date( 'Y-m-d H:i:s' ); |
|
| 322 | + $date = date('Y-m-d H:i:s'); |
|
| 323 | 323 | $billingAddress = $item->getPaymentAddress(); |
| 324 | 324 | |
| 325 | - if( $id === null ) |
|
| 325 | + if ($id === null) |
|
| 326 | 326 | { |
| 327 | 327 | /** mshop/customer/manager/laravel/insert |
| 328 | 328 | * Inserts a new customer record into the database table |
@@ -386,48 +386,48 @@ discard block |
||
| 386 | 386 | $path = 'mshop/customer/manager/laravel/update'; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - $stmt = $this->getCachedStatement( $conn, $path ); |
|
| 390 | - |
|
| 391 | - $stmt->bind( 1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
| 392 | - $stmt->bind( 2, $item->getCode() ); |
|
| 393 | - $stmt->bind( 3, $billingAddress->getCompany() ); |
|
| 394 | - $stmt->bind( 4, $billingAddress->getVatID() ); |
|
| 395 | - $stmt->bind( 5, $billingAddress->getSalutation() ); |
|
| 396 | - $stmt->bind( 6, $billingAddress->getTitle() ); |
|
| 397 | - $stmt->bind( 7, $billingAddress->getFirstname() ); |
|
| 398 | - $stmt->bind( 8, $billingAddress->getLastname() ); |
|
| 399 | - $stmt->bind( 9, $billingAddress->getAddress1() ); |
|
| 400 | - $stmt->bind( 10, $billingAddress->getAddress2() ); |
|
| 401 | - $stmt->bind( 11, $billingAddress->getAddress3() ); |
|
| 402 | - $stmt->bind( 12, $billingAddress->getPostal() ); |
|
| 403 | - $stmt->bind( 13, $billingAddress->getCity() ); |
|
| 404 | - $stmt->bind( 14, $billingAddress->getState() ); |
|
| 405 | - $stmt->bind( 15, $billingAddress->getCountryId() ); |
|
| 406 | - $stmt->bind( 16, $billingAddress->getLanguageId() ); |
|
| 407 | - $stmt->bind( 17, $billingAddress->getTelephone() ); |
|
| 408 | - $stmt->bind( 18, $billingAddress->getTelefax() ); |
|
| 409 | - $stmt->bind( 19, $billingAddress->getWebsite() ); |
|
| 410 | - $stmt->bind( 20, $billingAddress->getEmail() ); |
|
| 411 | - $stmt->bind( 21, $billingAddress->getLongitude() ); |
|
| 412 | - $stmt->bind( 22, $billingAddress->getLatitude() ); |
|
| 413 | - $stmt->bind( 23, $item->getLabel() ); |
|
| 414 | - $stmt->bind( 24, $item->getBirthday() ); |
|
| 415 | - $stmt->bind( 25, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
| 416 | - $stmt->bind( 26, $item->getDateVerified() ); |
|
| 417 | - $stmt->bind( 27, $item->getPassword() ); |
|
| 418 | - $stmt->bind( 28, $date ); // Modification time |
|
| 419 | - $stmt->bind( 29, $context->getEditor() ); |
|
| 420 | - |
|
| 421 | - if( $id !== null ) { |
|
| 422 | - $stmt->bind( 30, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
| 423 | - $item->setId( $id ); |
|
| 389 | + $stmt = $this->getCachedStatement($conn, $path); |
|
| 390 | + |
|
| 391 | + $stmt->bind(1, $context->getLocale()->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
| 392 | + $stmt->bind(2, $item->getCode()); |
|
| 393 | + $stmt->bind(3, $billingAddress->getCompany()); |
|
| 394 | + $stmt->bind(4, $billingAddress->getVatID()); |
|
| 395 | + $stmt->bind(5, $billingAddress->getSalutation()); |
|
| 396 | + $stmt->bind(6, $billingAddress->getTitle()); |
|
| 397 | + $stmt->bind(7, $billingAddress->getFirstname()); |
|
| 398 | + $stmt->bind(8, $billingAddress->getLastname()); |
|
| 399 | + $stmt->bind(9, $billingAddress->getAddress1()); |
|
| 400 | + $stmt->bind(10, $billingAddress->getAddress2()); |
|
| 401 | + $stmt->bind(11, $billingAddress->getAddress3()); |
|
| 402 | + $stmt->bind(12, $billingAddress->getPostal()); |
|
| 403 | + $stmt->bind(13, $billingAddress->getCity()); |
|
| 404 | + $stmt->bind(14, $billingAddress->getState()); |
|
| 405 | + $stmt->bind(15, $billingAddress->getCountryId()); |
|
| 406 | + $stmt->bind(16, $billingAddress->getLanguageId()); |
|
| 407 | + $stmt->bind(17, $billingAddress->getTelephone()); |
|
| 408 | + $stmt->bind(18, $billingAddress->getTelefax()); |
|
| 409 | + $stmt->bind(19, $billingAddress->getWebsite()); |
|
| 410 | + $stmt->bind(20, $billingAddress->getEmail()); |
|
| 411 | + $stmt->bind(21, $billingAddress->getLongitude()); |
|
| 412 | + $stmt->bind(22, $billingAddress->getLatitude()); |
|
| 413 | + $stmt->bind(23, $item->getLabel()); |
|
| 414 | + $stmt->bind(24, $item->getBirthday()); |
|
| 415 | + $stmt->bind(25, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
| 416 | + $stmt->bind(26, $item->getDateVerified()); |
|
| 417 | + $stmt->bind(27, $item->getPassword()); |
|
| 418 | + $stmt->bind(28, $date); // Modification time |
|
| 419 | + $stmt->bind(29, $context->getEditor()); |
|
| 420 | + |
|
| 421 | + if ($id !== null) { |
|
| 422 | + $stmt->bind(30, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
| 423 | + $item->setId($id); |
|
| 424 | 424 | } else { |
| 425 | - $stmt->bind( 30, $date ); // Creation time |
|
| 425 | + $stmt->bind(30, $date); // Creation time |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | $stmt->execute()->finish(); |
| 429 | 429 | |
| 430 | - if( $id === null && $fetch === true ) |
|
| 430 | + if ($id === null && $fetch === true) |
|
| 431 | 431 | { |
| 432 | 432 | /** mshop/customer/manager/laravel/newid |
| 433 | 433 | * Retrieves the ID generated by the database when inserting a new record |
@@ -460,22 +460,22 @@ discard block |
||
| 460 | 460 | * @see mshop/customer/manager/laravel/count |
| 461 | 461 | */ |
| 462 | 462 | $path = 'mshop/customer/manager/laravel/newid'; |
| 463 | - $item->setId( $this->newId( $conn, $path ) ); |
|
| 463 | + $item->setId($this->newId($conn, $path)); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | - $dbm->release( $conn, $dbname ); |
|
| 466 | + $dbm->release($conn, $dbname); |
|
| 467 | 467 | } |
| 468 | - catch( \Exception $e ) |
|
| 468 | + catch (\Exception $e) |
|
| 469 | 469 | { |
| 470 | - $dbm->release( $conn, $dbname ); |
|
| 470 | + $dbm->release($conn, $dbname); |
|
| 471 | 471 | throw $e; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - $this->addGroups( $item ); |
|
| 474 | + $this->addGroups($item); |
|
| 475 | 475 | |
| 476 | - $item = $this->savePropertyItems( $item, 'customer' ); |
|
| 477 | - $item = $this->saveAddressItems( $item, 'customer' ); |
|
| 478 | - return $this->saveRefItems( $item, 'customer' ); |
|
| 476 | + $item = $this->savePropertyItems($item, 'customer'); |
|
| 477 | + $item = $this->saveAddressItems($item, 'customer'); |
|
| 478 | + return $this->saveRefItems($item, 'customer'); |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
@@ -487,11 +487,11 @@ discard block |
||
| 487 | 487 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
| 488 | 488 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
| 489 | 489 | */ |
| 490 | - public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
|
| 490 | + public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null) |
|
| 491 | 491 | { |
| 492 | 492 | $dbm = $this->getContext()->getDatabaseManager(); |
| 493 | 493 | $dbname = $this->getResourceName(); |
| 494 | - $conn = $dbm->acquire( $dbname ); |
|
| 494 | + $conn = $dbm->acquire($dbname); |
|
| 495 | 495 | $map = []; |
| 496 | 496 | |
| 497 | 497 | try |
@@ -499,32 +499,32 @@ discard block |
||
| 499 | 499 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
| 500 | 500 | $cfgPathSearch = 'mshop/customer/manager/laravel/search'; |
| 501 | 501 | $cfgPathCount = 'mshop/customer/manager/laravel/count'; |
| 502 | - $required = array( 'customer' ); |
|
| 502 | + $required = array('customer'); |
|
| 503 | 503 | |
| 504 | - $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
|
| 505 | - while( ( $row = $results->fetch() ) !== false ) { |
|
| 506 | - $map[ $row['customer.id'] ] = $row; |
|
| 504 | + $results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level); |
|
| 505 | + while (($row = $results->fetch()) !== false) { |
|
| 506 | + $map[$row['customer.id']] = $row; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - $dbm->release( $conn, $dbname ); |
|
| 509 | + $dbm->release($conn, $dbname); |
|
| 510 | 510 | } |
| 511 | - catch( \Exception $e ) |
|
| 511 | + catch (\Exception $e) |
|
| 512 | 512 | { |
| 513 | - $dbm->release( $conn, $dbname ); |
|
| 513 | + $dbm->release($conn, $dbname); |
|
| 514 | 514 | throw $e; |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | $addrItems = []; |
| 518 | - if( in_array( 'customer/address', $ref, true ) ) { |
|
| 519 | - $addrItems = $this->getAddressItems( array_keys( $map ), 'customer' ); |
|
| 518 | + if (in_array('customer/address', $ref, true)) { |
|
| 519 | + $addrItems = $this->getAddressItems(array_keys($map), 'customer'); |
|
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | $propItems = []; |
| 523 | - if( in_array( 'customer/property', $ref, true ) ) { |
|
| 524 | - $propItems = $this->getPropertyItems( array_keys( $map ), 'customer' ); |
|
| 523 | + if (in_array('customer/property', $ref, true)) { |
|
| 524 | + $propItems = $this->getPropertyItems(array_keys($map), 'customer'); |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | - return $this->buildItems( $map, $ref, 'customer', $addrItems, $propItems ); |
|
| 527 | + return $this->buildItems($map, $ref, 'customer', $addrItems, $propItems); |
|
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
@@ -535,8 +535,8 @@ discard block |
||
| 535 | 535 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 536 | 536 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
| 537 | 537 | */ |
| 538 | - public function getSubManager( $manager, $name = null ) |
|
| 538 | + public function getSubManager($manager, $name = null) |
|
| 539 | 539 | { |
| 540 | - return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Laravel' : $name ) ); |
|
| 540 | + return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Laravel' : $name)); |
|
| 541 | 541 | } |
| 542 | 542 | } |
@@ -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', [] ); |
|
| 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', []); |
|
| 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', [] ); |
|
| 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', []); |
|
| 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 | }, |