@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Service\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -16,31 +16,31 @@ |
||
16 | 16 | { |
17 | 17 | $target = '\\Aimeos\\Controller\\Frontend\\Order\\Iface'; |
18 | 18 | |
19 | - $controller = \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext() ); |
|
20 | - $this->assertInstanceOf( $target, $controller ); |
|
19 | + $controller = \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext()); |
|
20 | + $this->assertInstanceOf($target, $controller); |
|
21 | 21 | |
22 | - $controller = \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
23 | - $this->assertInstanceOf( $target, $controller ); |
|
22 | + $controller = \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
23 | + $this->assertInstanceOf($target, $controller); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | public function testCreateControllerInvalidImplementation() |
28 | 28 | { |
29 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
30 | - \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
29 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
30 | + \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testCreateControllerInvalidName() |
35 | 35 | { |
36 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
37 | - \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
36 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
37 | + \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testCreateControllerNotExisting() |
42 | 42 | { |
43 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
44 | - \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
43 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
44 | + \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
45 | 45 | } |
46 | 46 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Customer\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Customer\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Customer\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Customer\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Customer\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Customer\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Customer\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Customer\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Customer\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Customer\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Customer\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Stock\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
21 | + $this->assertInstanceOf($target, $controller); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | 25 | public function testCreateControllerInvalidImplementation() |
26 | 26 | { |
27 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCreateControllerInvalidName() |
33 | 33 | { |
34 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
35 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testCreateControllerNotExisting() |
40 | 40 | { |
41 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
42 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Basket\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
21 | + $this->assertInstanceOf($target, $controller); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | 25 | public function testCreateControllerInvalidImplementation() |
26 | 26 | { |
27 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCreateControllerInvalidName() |
33 | 33 | { |
34 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
35 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testCreateControllerNotExisting() |
40 | 40 | { |
41 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
42 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | * @param string $stocktype Unique code of the stock type to deliver the products from |
37 | 37 | * @throws \Aimeos\Controller\Frontend\Basket\Exception If the product isn't available |
38 | 38 | */ |
39 | - public function addProduct( $prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [], |
|
40 | - array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [] ) |
|
39 | + public function addProduct($prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [], |
|
40 | + array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = []) |
|
41 | 41 | { |
42 | 42 | $context = $this->getContext(); |
43 | - $productManager = \Aimeos\MShop\Factory::createManager( $context, 'product' ); |
|
43 | + $productManager = \Aimeos\MShop\Factory::createManager($context, 'product'); |
|
44 | 44 | |
45 | - if( $productManager->getItem( $prodid, [], true )->getType() !== 'bundle' ) |
|
45 | + if ($productManager->getItem($prodid, [], true)->getType() !== 'bundle') |
|
46 | 46 | { |
47 | 47 | return $this->getController()->addProduct( |
48 | 48 | $prodid, $quantity, $stocktype, $variantAttributeIds, |
@@ -51,29 +51,29 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $attributeMap = [ |
54 | - 'custom' => array_keys( $customAttributeValues ), |
|
55 | - 'config' => array_keys( $configAttributeIds ), |
|
54 | + 'custom' => array_keys($customAttributeValues), |
|
55 | + 'config' => array_keys($configAttributeIds), |
|
56 | 56 | ]; |
57 | - $this->checkListRef( $prodid, 'attribute', $attributeMap ); |
|
57 | + $this->checkListRef($prodid, 'attribute', $attributeMap); |
|
58 | 58 | |
59 | 59 | |
60 | - $productItem = $productManager->getItem( $prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true ); |
|
61 | - $prices = $productItem->getRefItems( 'price', 'default', 'default' ); |
|
62 | - $hidden = $productItem->getRefItems( 'attribute', null, 'hidden' ); |
|
60 | + $productItem = $productManager->getItem($prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true); |
|
61 | + $prices = $productItem->getRefItems('price', 'default', 'default'); |
|
62 | + $hidden = $productItem->getRefItems('attribute', null, 'hidden'); |
|
63 | 63 | |
64 | - $orderBaseProductItem = \Aimeos\MShop\Factory::createManager( $context, 'order/base/product' )->createItem(); |
|
65 | - $orderBaseProductItem->copyFrom( $productItem )->setQuantity( $quantity )->setStockType( $stocktype ); |
|
64 | + $orderBaseProductItem = \Aimeos\MShop\Factory::createManager($context, 'order/base/product')->createItem(); |
|
65 | + $orderBaseProductItem->copyFrom($productItem)->setQuantity($quantity)->setStockType($stocktype); |
|
66 | 66 | |
67 | - $this->addBundleProducts( $orderBaseProductItem, $productItem, $variantAttributeIds, $stocktype ); |
|
67 | + $this->addBundleProducts($orderBaseProductItem, $productItem, $variantAttributeIds, $stocktype); |
|
68 | 68 | |
69 | - $custAttr = $this->getOrderProductAttributes( 'custom', array_keys( $customAttributeValues ), $customAttributeValues ); |
|
70 | - $confAttr = $this->getOrderProductAttributes( 'config', array_keys( $configAttributeIds ), [], $configAttributeIds ); |
|
71 | - $attr = array_merge( $custAttr, $confAttr, $this->getOrderProductAttributes( 'hidden', array_keys( $hidden ) ) ); |
|
69 | + $custAttr = $this->getOrderProductAttributes('custom', array_keys($customAttributeValues), $customAttributeValues); |
|
70 | + $confAttr = $this->getOrderProductAttributes('config', array_keys($configAttributeIds), [], $configAttributeIds); |
|
71 | + $attr = array_merge($custAttr, $confAttr, $this->getOrderProductAttributes('hidden', array_keys($hidden))); |
|
72 | 72 | |
73 | - $orderBaseProductItem->setAttributeItems( $attr ); |
|
74 | - $orderBaseProductItem->setPrice( $this->calcPrice( $orderBaseProductItem, $prices, $quantity ) ); |
|
73 | + $orderBaseProductItem->setAttributeItems($attr); |
|
74 | + $orderBaseProductItem->setPrice($this->calcPrice($orderBaseProductItem, $prices, $quantity)); |
|
75 | 75 | |
76 | - $this->getController()->get()->addProduct( $orderBaseProductItem ); |
|
76 | + $this->getController()->get()->addProduct($orderBaseProductItem); |
|
77 | 77 | $this->getController()->save(); |
78 | 78 | } |
79 | 79 | |
@@ -86,43 +86,43 @@ discard block |
||
86 | 86 | * @param array $variantAttributeIds List of product variant attribute IDs |
87 | 87 | * @param string $stocktype |
88 | 88 | */ |
89 | - protected function addBundleProducts( \Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem, |
|
90 | - \Aimeos\MShop\Product\Item\Iface $productItem, array $variantAttributeIds, $stocktype ) |
|
89 | + protected function addBundleProducts(\Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem, |
|
90 | + \Aimeos\MShop\Product\Item\Iface $productItem, array $variantAttributeIds, $stocktype) |
|
91 | 91 | { |
92 | 92 | $quantity = $orderBaseProductItem->getQuantity(); |
93 | 93 | $products = $subProductIds = $orderProducts = []; |
94 | - $orderProductManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base/product' ); |
|
94 | + $orderProductManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base/product'); |
|
95 | 95 | |
96 | - foreach( $productItem->getRefItems( 'product', null, 'default' ) as $item ) { |
|
96 | + foreach ($productItem->getRefItems('product', null, 'default') as $item) { |
|
97 | 97 | $subProductIds[] = $item->getId(); |
98 | 98 | } |
99 | 99 | |
100 | - if( count( $subProductIds ) > 0 ) |
|
100 | + if (count($subProductIds) > 0) |
|
101 | 101 | { |
102 | - $productManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' ); |
|
102 | + $productManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product'); |
|
103 | 103 | |
104 | - $search = $productManager->createSearch( true ); |
|
104 | + $search = $productManager->createSearch(true); |
|
105 | 105 | $expr = array( |
106 | - $search->compare( '==', 'product.id', $subProductIds ), |
|
106 | + $search->compare('==', 'product.id', $subProductIds), |
|
107 | 107 | $search->getConditions(), |
108 | 108 | ); |
109 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
109 | + $search->setConditions($search->combine('&&', $expr)); |
|
110 | 110 | |
111 | - $products = $productManager->searchItems( $search, array( 'attribute', 'media', 'price', 'text' ) ); |
|
111 | + $products = $productManager->searchItems($search, array('attribute', 'media', 'price', 'text')); |
|
112 | 112 | } |
113 | 113 | |
114 | - foreach( $products as $product ) |
|
114 | + foreach ($products as $product) |
|
115 | 115 | { |
116 | - $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
116 | + $prices = $product->getRefItems('price', 'default', 'default'); |
|
117 | 117 | |
118 | 118 | $orderProduct = $orderProductManager->createItem(); |
119 | - $orderProduct->copyFrom( $product ); |
|
120 | - $orderProduct->setStockType( $stocktype ); |
|
121 | - $orderProduct->setPrice( $this->calcPrice( $orderProduct, $prices, $quantity ) ); |
|
119 | + $orderProduct->copyFrom($product); |
|
120 | + $orderProduct->setStockType($stocktype); |
|
121 | + $orderProduct->setPrice($this->calcPrice($orderProduct, $prices, $quantity)); |
|
122 | 122 | |
123 | 123 | $orderProducts[] = $orderProduct; |
124 | 124 | } |
125 | 125 | |
126 | - $orderBaseProductItem->setProducts( $orderProducts ); |
|
126 | + $orderBaseProductItem->setProducts($orderProducts); |
|
127 | 127 | } |
128 | 128 | } |