@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
23 | 23 | $this->view = $this->context->getView(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JsonAdm\Price\Standard( $this->context, $this->view, $templatePaths, 'price' ); |
|
25 | + $this->object = new \Aimeos\Admin\JsonAdm\Price\Standard($this->context, $this->view, $templatePaths, 'price'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -30,26 +30,26 @@ discard block |
||
30 | 30 | { |
31 | 31 | $params = array( |
32 | 32 | 'filter' => array( |
33 | - '==' => array( 'price.value' => '12.95' ) |
|
33 | + '==' => array('price.value' => '12.95') |
|
34 | 34 | ), |
35 | 35 | 'include' => 'attribute' |
36 | 36 | ); |
37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
38 | - $this->view->addHelper( 'param', $helper ); |
|
37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
38 | + $this->view->addHelper('param', $helper); |
|
39 | 39 | |
40 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
41 | - $result = json_decode( (string) $response->getBody(), true ); |
|
40 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
41 | + $result = json_decode((string) $response->getBody(), true); |
|
42 | 42 | |
43 | 43 | |
44 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
45 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
44 | + $this->assertEquals(200, $response->getStatusCode()); |
|
45 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
46 | 46 | |
47 | - $this->assertEquals( 2, $result['meta']['total'] ); |
|
48 | - $this->assertEquals( 2, count( $result['data'] ) ); |
|
49 | - $this->assertEquals( 'price', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 0, count( $result['data'][0]['relationships'] ) ); |
|
51 | - $this->assertEquals( 0, count( $result['included'] ) ); |
|
47 | + $this->assertEquals(2, $result['meta']['total']); |
|
48 | + $this->assertEquals(2, count($result['data'])); |
|
49 | + $this->assertEquals('price', $result['data'][0]['type']); |
|
50 | + $this->assertEquals(0, count($result['data'][0]['relationships'])); |
|
51 | + $this->assertEquals(0, count($result['included'])); |
|
52 | 52 | |
53 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
53 | + $this->assertArrayNotHasKey('errors', $result); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @param array $templatePaths List of file system paths where the templates are stored |
37 | 37 | * @param string $path Name of the client separated by slashes, e.g "product/property" |
38 | 38 | */ |
39 | - public function __construct( \Aimeos\Admin\JsonAdm\Iface $client, |
|
40 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, array $templatePaths, $path ) |
|
39 | + public function __construct(\Aimeos\Admin\JsonAdm\Iface $client, |
|
40 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, array $templatePaths, $path) |
|
41 | 41 | { |
42 | - parent::__construct( $context, $view, $templatePaths, $path ); |
|
42 | + parent::__construct($context, $view, $templatePaths, $path); |
|
43 | 43 | |
44 | 44 | $this->client = $client; |
45 | 45 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Admin\JsonAdm\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->client, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->client, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
67 | 67 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
68 | 68 | */ |
69 | - public function delete( ServerRequestInterface $request, ResponseInterface $response ) |
|
69 | + public function delete(ServerRequestInterface $request, ResponseInterface $response) |
|
70 | 70 | { |
71 | - return $this->client->delete( $request, $response ); |
|
71 | + return $this->client->delete($request, $response); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
80 | 80 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
81 | 81 | */ |
82 | - public function get( ServerRequestInterface $request, ResponseInterface $response ) |
|
82 | + public function get(ServerRequestInterface $request, ResponseInterface $response) |
|
83 | 83 | { |
84 | - return $this->client->get( $request, $response ); |
|
84 | + return $this->client->get($request, $response); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
94 | 94 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
95 | 95 | */ |
96 | - public function patch( ServerRequestInterface $request, ResponseInterface $response ) |
|
96 | + public function patch(ServerRequestInterface $request, ResponseInterface $response) |
|
97 | 97 | { |
98 | - return $this->client->patch( $request, $response ); |
|
98 | + return $this->client->patch($request, $response); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
108 | 108 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
109 | 109 | */ |
110 | - public function post( ServerRequestInterface $request, ResponseInterface $response ) |
|
110 | + public function post(ServerRequestInterface $request, ResponseInterface $response) |
|
111 | 111 | { |
112 | - return $this->client->post( $request, $response ); |
|
112 | + return $this->client->post($request, $response); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
122 | 122 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
123 | 123 | */ |
124 | - public function put( ServerRequestInterface $request, ResponseInterface $response ) |
|
124 | + public function put(ServerRequestInterface $request, ResponseInterface $response) |
|
125 | 125 | { |
126 | - return $this->client->put( $request, $response ); |
|
126 | + return $this->client->put($request, $response); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | * @param string|null $prefix Form parameter prefix when nesting parameters is required |
137 | 137 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
138 | 138 | */ |
139 | - public function options( ServerRequestInterface $request, ResponseInterface $response, $prefix = null ) |
|
139 | + public function options(ServerRequestInterface $request, ResponseInterface $response, $prefix = null) |
|
140 | 140 | { |
141 | - return $this->client->options( $request, $response, $prefix ); |
|
141 | + return $this->client->options($request, $response, $prefix); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 |
@@ -21,29 +21,29 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->client = new \Aimeos\Admin\JsonAdm\Product\Standard( $this->context, $this->view, [], '' ); |
|
24 | + $this->client = new \Aimeos\Admin\JsonAdm\Product\Standard($this->context, $this->view, [], ''); |
|
25 | 25 | |
26 | - $this->object = $this->getMockBuilder( '\Aimeos\Admin\JsonAdm\Common\Factory\Base' ) |
|
26 | + $this->object = $this->getMockBuilder('\Aimeos\Admin\JsonAdm\Common\Factory\Base') |
|
27 | 27 | ->getMockForAbstractClass(); |
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testinjectClient() |
32 | 32 | { |
33 | - $this->object->injectClient( 'test', $this->client ); |
|
33 | + $this->object->injectClient('test', $this->client); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testAddClientDecorators() |
38 | 38 | { |
39 | 39 | $config = $this->context->getConfig(); |
40 | - $config->set( 'client/jsonapi/common/decorators/default', ['Test'] ); |
|
41 | - $config->set( 'client/jsonapi/product/decorators/excludes', ['Test'] ); |
|
40 | + $config->set('client/jsonapi/common/decorators/default', ['Test']); |
|
41 | + $config->set('client/jsonapi/product/decorators/excludes', ['Test']); |
|
42 | 42 | |
43 | 43 | $params = [$this->client, $this->context, $this->view, [], 'product']; |
44 | - $result = $this->access( 'addClientDecorators' )->invokeArgs( $this->object, $params ); |
|
44 | + $result = $this->access('addClientDecorators')->invokeArgs($this->object, $params); |
|
45 | 45 | |
46 | - $this->assertInstanceOf( '\Aimeos\\Admin\\JsonAdm\\Iface', $result ); |
|
46 | + $this->assertInstanceOf('\Aimeos\\Admin\\JsonAdm\\Iface', $result); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $prefix = '\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; |
53 | 53 | $params = [$this->client, ['Example'], $prefix, $this->context, $this->view, [], '']; |
54 | 54 | |
55 | - $result = $this->access( 'addDecorators' )->invokeArgs( $this->object, $params ); |
|
55 | + $result = $this->access('addDecorators')->invokeArgs($this->object, $params); |
|
56 | 56 | |
57 | - $this->assertInstanceOf( '\Aimeos\\Admin\\JsonAdm\\Iface', $result ); |
|
57 | + $this->assertInstanceOf('\Aimeos\\Admin\\JsonAdm\\Iface', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | $prefix = '\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; |
64 | 64 | $params = [$this->client, ['Test'], $prefix, $this->context, $this->view, [], '']; |
65 | 65 | |
66 | - $this->setExpectedException( '\Aimeos\Admin\JsonAdm\Exception' ); |
|
67 | - $this->access( 'addDecorators' )->invokeArgs( $this->object, $params ); |
|
66 | + $this->setExpectedException('\Aimeos\Admin\JsonAdm\Exception'); |
|
67 | + $this->access('addDecorators')->invokeArgs($this->object, $params); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $prefix = '\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; |
74 | 74 | $params = [$this->client, [''], $prefix, $this->context, $this->view, [], '']; |
75 | 75 | |
76 | - $this->setExpectedException( '\Aimeos\Admin\JsonAdm\Exception' ); |
|
77 | - $this->access( 'addDecorators' )->invokeArgs( $this->object, $params ); |
|
76 | + $this->setExpectedException('\Aimeos\Admin\JsonAdm\Exception'); |
|
77 | + $this->access('addDecorators')->invokeArgs($this->object, $params); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $class = '\Aimeos\\Admin\\JsonAdm\\Product\\Standard'; |
85 | 85 | $params = [$class, $iface, $this->context, $this->view, [], '']; |
86 | 86 | |
87 | - $result = $this->access( 'createClientBase' )->invokeArgs( $this->object, $params ); |
|
87 | + $result = $this->access('createClientBase')->invokeArgs($this->object, $params); |
|
88 | 88 | |
89 | - $this->assertInstanceOf( '\Aimeos\\Admin\\JsonAdm\\Iface', $result ); |
|
89 | + $this->assertInstanceOf('\Aimeos\\Admin\\JsonAdm\\Iface', $result); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | $iface = '\Aimeos\\Admin\\JsonAdm\\Iface'; |
96 | 96 | $params = ['test', $iface, $this->context, $this->view, [], '']; |
97 | 97 | |
98 | - $this->object->injectClient( 'test', $this->client ); |
|
99 | - $result = $this->access( 'createClientBase' )->invokeArgs( $this->object, $params ); |
|
98 | + $this->object->injectClient('test', $this->client); |
|
99 | + $result = $this->access('createClientBase')->invokeArgs($this->object, $params); |
|
100 | 100 | |
101 | - $this->assertSame( $this->client, $result ); |
|
101 | + $this->assertSame($this->client, $result); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | $iface = '\Aimeos\\Admin\\JsonAdm\\Iface'; |
108 | 108 | $params = ['invalid', $iface, $this->context, $this->view, [], '']; |
109 | 109 | |
110 | - $this->setExpectedException( '\Aimeos\Admin\JsonAdm\Exception' ); |
|
111 | - $this->access( 'createClientBase' )->invokeArgs( $this->object, $params ); |
|
110 | + $this->setExpectedException('\Aimeos\Admin\JsonAdm\Exception'); |
|
111 | + $this->access('createClientBase')->invokeArgs($this->object, $params); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | $class = '\Aimeos\\Admin\\JsonAdm\\Product\\Standard'; |
119 | 119 | $params = [$class, $iface, $this->context, $this->view, [], '']; |
120 | 120 | |
121 | - $this->setExpectedException( '\Aimeos\Admin\JsonAdm\Exception' ); |
|
122 | - $this->access( 'createClientBase' )->invokeArgs( $this->object, $params ); |
|
121 | + $this->setExpectedException('\Aimeos\Admin\JsonAdm\Exception'); |
|
122 | + $this->access('createClientBase')->invokeArgs($this->object, $params); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
126 | - protected function access( $name ) |
|
126 | + protected function access($name) |
|
127 | 127 | { |
128 | - $class = new \ReflectionClass( '\Aimeos\Admin\JsonAdm\Common\Factory\Base' ); |
|
129 | - $method = $class->getMethod( $name ); |
|
130 | - $method->setAccessible( true ); |
|
128 | + $class = new \ReflectionClass('\Aimeos\Admin\JsonAdm\Common\Factory\Base'); |
|
129 | + $method = $class->getMethod($name); |
|
130 | + $method->setAccessible(true); |
|
131 | 131 | |
132 | 132 | return $method; |
133 | 133 | } |
@@ -15,15 +15,15 @@ discard block |
||
15 | 15 | public static function bootstrap() |
16 | 16 | { |
17 | 17 | self::getAimeos(); |
18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
19 | - \Aimeos\Admin\JsonAdm\Factory::setCache( false ); |
|
18 | + \Aimeos\MShop\Factory::setCache(false); |
|
19 | + \Aimeos\Admin\JsonAdm\Factory::setCache(false); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | |
23 | - public static function getContext( $site = 'unittest' ) |
|
23 | + public static function getContext($site = 'unittest') |
|
24 | 24 | { |
25 | - if( !isset( self::$context[$site] ) ) { |
|
26 | - self::$context[$site] = self::createContext( $site ); |
|
25 | + if (!isset(self::$context[$site])) { |
|
26 | + self::$context[$site] = self::createContext($site); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | return clone self::$context[$site]; |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | |
33 | 33 | public static function getAimeos() |
34 | 34 | { |
35 | - if( !isset( self::$aimeos ) ) |
|
35 | + if (!isset(self::$aimeos)) |
|
36 | 36 | { |
37 | 37 | require_once 'Bootstrap.php'; |
38 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
38 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
39 | 39 | |
40 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
41 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
40 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
41 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | return self::$aimeos; |
@@ -47,85 +47,85 @@ discard block |
||
47 | 47 | |
48 | 48 | public static function getJsonadmPaths() |
49 | 49 | { |
50 | - return self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' ); |
|
50 | + return self::getAimeos()->getCustomPaths('admin/jsonadm/templates'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | - private static function createContext( $site ) |
|
54 | + private static function createContext($site) |
|
55 | 55 | { |
56 | 56 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
57 | 57 | $aimeos = self::getAimeos(); |
58 | 58 | |
59 | 59 | |
60 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
60 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
61 | 61 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
62 | 62 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
63 | 63 | |
64 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
|
65 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
66 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
67 | - $ctx->setConfig( $conf ); |
|
64 | + $conf = new \Aimeos\MW\Config\PHPArray([], $paths); |
|
65 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
66 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
67 | + $ctx->setConfig($conf); |
|
68 | 68 | |
69 | 69 | |
70 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
71 | - $ctx->setDatabaseManager( $dbm ); |
|
70 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
71 | + $ctx->setDatabaseManager($dbm); |
|
72 | 72 | |
73 | 73 | |
74 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
75 | - $ctx->setLogger( $logger ); |
|
74 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
75 | + $ctx->setLogger($logger); |
|
76 | 76 | |
77 | 77 | |
78 | 78 | $session = new \Aimeos\MW\Session\None(); |
79 | - $ctx->setSession( $session ); |
|
79 | + $ctx->setSession($session); |
|
80 | 80 | |
81 | 81 | |
82 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
83 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
82 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
83 | + $ctx->setI18n(array('de' => $i18n)); |
|
84 | 84 | |
85 | 85 | |
86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
87 | - $locale = $localeManager->bootstrap( $site, 'de', '', false ); |
|
88 | - $ctx->setLocale( $locale ); |
|
86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
87 | + $locale = $localeManager->bootstrap($site, 'de', '', false); |
|
88 | + $ctx->setLocale($locale); |
|
89 | 89 | |
90 | 90 | |
91 | - $view = self::createView( $conf ); |
|
92 | - $ctx->setView( $view ); |
|
91 | + $view = self::createView($conf); |
|
92 | + $ctx->setView($view); |
|
93 | 93 | |
94 | 94 | |
95 | - $ctx->setEditor( 'core:admin/jsonadm' ); |
|
95 | + $ctx->setEditor('core:admin/jsonadm'); |
|
96 | 96 | |
97 | 97 | return $ctx; |
98 | 98 | } |
99 | 99 | |
100 | 100 | |
101 | - protected static function createView( \Aimeos\MW\Config\Iface $config ) |
|
101 | + protected static function createView(\Aimeos\MW\Config\Iface $config) |
|
102 | 102 | { |
103 | - $tmplpaths = self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' ); |
|
103 | + $tmplpaths = self::getAimeos()->getCustomPaths('admin/jsonadm/templates'); |
|
104 | 104 | |
105 | - $view = new \Aimeos\MW\View\Standard( $tmplpaths ); |
|
105 | + $view = new \Aimeos\MW\View\Standard($tmplpaths); |
|
106 | 106 | |
107 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
108 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
109 | - $view->addHelper( 'translate', $helper ); |
|
107 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
108 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
109 | + $view->addHelper('translate', $helper); |
|
110 | 110 | |
111 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
112 | - $view->addHelper( 'url', $helper ); |
|
111 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
112 | + $view->addHelper('url', $helper); |
|
113 | 113 | |
114 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
115 | - $view->addHelper( 'number', $helper ); |
|
114 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
115 | + $view->addHelper('number', $helper); |
|
116 | 116 | |
117 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
118 | - $view->addHelper( 'date', $helper ); |
|
117 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
118 | + $view->addHelper('date', $helper); |
|
119 | 119 | |
120 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin/jsonadm' ) ); |
|
121 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
122 | - $view->addHelper( 'config', $helper ); |
|
120 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin/jsonadm')); |
|
121 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
122 | + $view->addHelper('config', $helper); |
|
123 | 123 | |
124 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() ); |
|
125 | - $view->addHelper( 'request', $helper ); |
|
124 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest()); |
|
125 | + $view->addHelper('request', $helper); |
|
126 | 126 | |
127 | - $helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() ); |
|
128 | - $view->addHelper( 'response', $helper ); |
|
127 | + $helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response()); |
|
128 | + $view->addHelper('response', $helper); |
|
129 | 129 | |
130 | 130 | return $view; |
131 | 131 | } |
@@ -21,88 +21,88 @@ |
||
21 | 21 | $context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $context->getView(); |
23 | 23 | |
24 | - $this->stub = $this->getMockBuilder( '\\Aimeos\\Admin\\JsonAdm\\Standard' ) |
|
25 | - ->setConstructorArgs( array( $context, $this->view, [], 'attribute' ) ) |
|
24 | + $this->stub = $this->getMockBuilder('\\Aimeos\\Admin\\JsonAdm\\Standard') |
|
25 | + ->setConstructorArgs(array($context, $this->view, [], 'attribute')) |
|
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->object = $this->getMockBuilder( '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\Base' ) |
|
29 | - ->setConstructorArgs( [$this->stub, $context, $this->view, [], ''] ) |
|
28 | + $this->object = $this->getMockBuilder('\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\Base') |
|
29 | + ->setConstructorArgs([$this->stub, $context, $this->view, [], '']) |
|
30 | 30 | ->getMockForAbstractClass(); |
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | protected function tearDown() |
35 | 35 | { |
36 | - unset( $this->object, $this->stub, $this->view ); |
|
36 | + unset($this->object, $this->stub, $this->view); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testDelete() |
41 | 41 | { |
42 | - $this->stub->expects( $this->once() )->method( 'delete' )->will( $this->returnArgument( 1 ) ); |
|
42 | + $this->stub->expects($this->once())->method('delete')->will($this->returnArgument(1)); |
|
43 | 43 | $response = $this->view->response(); |
44 | 44 | |
45 | - $this->assertSame( $response, $this->object->delete( $this->view->request(), $response ) ); |
|
45 | + $this->assertSame($response, $this->object->delete($this->view->request(), $response)); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGet() |
50 | 50 | { |
51 | - $this->stub->expects( $this->once() )->method( 'get' )->will( $this->returnArgument( 1 ) ); |
|
51 | + $this->stub->expects($this->once())->method('get')->will($this->returnArgument(1)); |
|
52 | 52 | $response = $this->view->response(); |
53 | 53 | |
54 | - $this->assertSame( $response, $this->object->get( $this->view->request(), $response ) ); |
|
54 | + $this->assertSame($response, $this->object->get($this->view->request(), $response)); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | 58 | public function testPatch() |
59 | 59 | { |
60 | - $this->stub->expects( $this->once() )->method( 'patch' )->will( $this->returnArgument( 1 ) ); |
|
60 | + $this->stub->expects($this->once())->method('patch')->will($this->returnArgument(1)); |
|
61 | 61 | $response = $this->view->response(); |
62 | 62 | |
63 | - $this->assertSame( $response, $this->object->patch( $this->view->request(), $response ) ); |
|
63 | + $this->assertSame($response, $this->object->patch($this->view->request(), $response)); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | 67 | public function testPost() |
68 | 68 | { |
69 | - $this->stub->expects( $this->once() )->method( 'post' )->will( $this->returnArgument( 1 ) ); |
|
69 | + $this->stub->expects($this->once())->method('post')->will($this->returnArgument(1)); |
|
70 | 70 | $response = $this->view->response(); |
71 | 71 | |
72 | - $this->assertSame( $response, $this->object->post( $this->view->request(), $response ) ); |
|
72 | + $this->assertSame($response, $this->object->post($this->view->request(), $response)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | 76 | public function testPut() |
77 | 77 | { |
78 | - $this->stub->expects( $this->once() )->method( 'put' )->will( $this->returnArgument( 1 ) ); |
|
78 | + $this->stub->expects($this->once())->method('put')->will($this->returnArgument(1)); |
|
79 | 79 | $response = $this->view->response(); |
80 | 80 | |
81 | - $this->assertSame( $response, $this->object->put( $this->view->request(), $response ) ); |
|
81 | + $this->assertSame($response, $this->object->put($this->view->request(), $response)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testOptions() |
86 | 86 | { |
87 | - $this->stub->expects( $this->once() )->method( 'options' )->will( $this->returnArgument( 1 ) ); |
|
87 | + $this->stub->expects($this->once())->method('options')->will($this->returnArgument(1)); |
|
88 | 88 | $response = $this->view->response(); |
89 | 89 | |
90 | - $this->assertSame( $response, $this->object->options( $this->view->request(), $response ) ); |
|
90 | + $this->assertSame($response, $this->object->options($this->view->request(), $response)); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
94 | 94 | public function testGetClient() |
95 | 95 | { |
96 | - $result = $this->access( 'getClient' )->invokeArgs( $this->object, [] ); |
|
97 | - $this->assertSame( $this->stub, $result ); |
|
96 | + $result = $this->access('getClient')->invokeArgs($this->object, []); |
|
97 | + $this->assertSame($this->stub, $result); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
101 | - protected function access( $name ) |
|
101 | + protected function access($name) |
|
102 | 102 | { |
103 | - $class = new \ReflectionClass( '\Aimeos\Admin\JsonAdm\Common\Decorator\Base' ); |
|
104 | - $method = $class->getMethod( $name ); |
|
105 | - $method->setAccessible( true ); |
|
103 | + $class = new \ReflectionClass('\Aimeos\Admin\JsonAdm\Common\Decorator\Base'); |
|
104 | + $method = $class->getMethod($name); |
|
105 | + $method->setAccessible(true); |
|
106 | 106 | |
107 | 107 | return $method; |
108 | 108 | } |
@@ -182,8 +182,7 @@ discard block |
||
182 | 182 | $view->data = $manager->searchItems( $search, [], $total ); |
183 | 183 | $view->listItems = $this->getListItems( $view->data, $include ); |
184 | 184 | $view->childItems = $this->getChildItems( $view->data, $include ); |
185 | - } |
|
186 | - else |
|
185 | + } else |
|
187 | 186 | { |
188 | 187 | $view->data = $manager->getTree( $id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search ); |
189 | 188 | $view->listItems = $this->getListItems( array( $id => $view->data ), $include ); |
@@ -240,8 +239,7 @@ discard block |
||
240 | 239 | if( isset( $entry->parentid ) && $targetId !== null ) { |
241 | 240 | $manager->moveItem( $item->getId(), $entry->parentid, $targetId, $refId ); |
242 | 241 | } |
243 | - } |
|
244 | - else |
|
242 | + } else |
|
245 | 243 | { |
246 | 244 | $item = $manager->createItem(); |
247 | 245 | $item = $this->addItemData( $manager, $item, $entry, $item->getResourceType() ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
111 | 111 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
112 | 112 | */ |
113 | - public function get( ServerRequestInterface $request, ResponseInterface $response ) |
|
113 | + public function get(ServerRequestInterface $request, ResponseInterface $response) |
|
114 | 114 | { |
115 | 115 | /** admin/jsonadm/partials/catalog/template-data |
116 | 116 | * Relative path to the data partial template file for the catalog client |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | * @since 2016.07 |
128 | 128 | * @category Developer |
129 | 129 | */ |
130 | - $this->getView()->assign( array( 'partial-data' => 'admin/jsonadm/partials/catalog/template-data' ) ); |
|
130 | + $this->getView()->assign(array('partial-data' => 'admin/jsonadm/partials/catalog/template-data')); |
|
131 | 131 | |
132 | - return parent::get( $request, $response ); |
|
132 | + return parent::get($request, $response); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | * @param array $include List of resource types that should be fetched |
141 | 141 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
142 | 142 | */ |
143 | - protected function getChildItems( array $items, array $include ) |
|
143 | + protected function getChildItems(array $items, array $include) |
|
144 | 144 | { |
145 | 145 | $list = []; |
146 | 146 | |
147 | - if( in_array( 'catalog', $include ) ) |
|
147 | + if (in_array('catalog', $include)) |
|
148 | 148 | { |
149 | - foreach( $items as $item ) { |
|
150 | - $list = array_merge( $list, $item->getChildren() ); |
|
149 | + foreach ($items as $item) { |
|
150 | + $list = array_merge($list, $item->getChildren()); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
@@ -162,35 +162,35 @@ discard block |
||
162 | 162 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
163 | 163 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
164 | 164 | */ |
165 | - protected function getItems( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response ) |
|
165 | + protected function getItems(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response) |
|
166 | 166 | { |
167 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' ); |
|
167 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog'); |
|
168 | 168 | |
169 | - if( ( $key = $view->param( 'aggregate' ) ) !== null ) |
|
169 | + if (($key = $view->param('aggregate')) !== null) |
|
170 | 170 | { |
171 | - $search = $this->initCriteria( $manager->createSearch(), $view->param() ); |
|
172 | - $view->data = $manager->aggregate( $search, $key ); |
|
171 | + $search = $this->initCriteria($manager->createSearch(), $view->param()); |
|
172 | + $view->data = $manager->aggregate($search, $key); |
|
173 | 173 | return $response; |
174 | 174 | } |
175 | 175 | |
176 | - $include = ( ( $include = $view->param( 'include' ) ) !== null ? explode( ',', $include ) : [] ); |
|
177 | - $search = $this->initCriteria( $manager->createSearch(), $view->param() ); |
|
176 | + $include = (($include = $view->param('include')) !== null ? explode(',', $include) : []); |
|
177 | + $search = $this->initCriteria($manager->createSearch(), $view->param()); |
|
178 | 178 | $total = 1; |
179 | 179 | |
180 | - if( ( $id = $view->param( 'id' ) ) == null ) |
|
180 | + if (($id = $view->param('id')) == null) |
|
181 | 181 | { |
182 | - $view->data = $manager->searchItems( $search, [], $total ); |
|
183 | - $view->listItems = $this->getListItems( $view->data, $include ); |
|
184 | - $view->childItems = $this->getChildItems( $view->data, $include ); |
|
182 | + $view->data = $manager->searchItems($search, [], $total); |
|
183 | + $view->listItems = $this->getListItems($view->data, $include); |
|
184 | + $view->childItems = $this->getChildItems($view->data, $include); |
|
185 | 185 | } |
186 | 186 | else |
187 | 187 | { |
188 | - $view->data = $manager->getTree( $id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search ); |
|
189 | - $view->listItems = $this->getListItems( array( $id => $view->data ), $include ); |
|
190 | - $view->childItems = $this->getChildItems( array( $view->data ), $include ); |
|
188 | + $view->data = $manager->getTree($id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search); |
|
189 | + $view->listItems = $this->getListItems(array($id => $view->data), $include); |
|
190 | + $view->childItems = $this->getChildItems(array($view->data), $include); |
|
191 | 191 | } |
192 | 192 | |
193 | - $view->refItems = $this->getRefItems( $view->listItems ); |
|
193 | + $view->refItems = $this->getRefItems($view->listItems); |
|
194 | 194 | $view->total = $total; |
195 | 195 | |
196 | 196 | return $response; |
@@ -204,18 +204,18 @@ discard block |
||
204 | 204 | * @param array $include List of resource types that should be fetched |
205 | 205 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
206 | 206 | */ |
207 | - protected function getListItems( array $items, array $include ) |
|
207 | + protected function getListItems(array $items, array $include) |
|
208 | 208 | { |
209 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog/lists' ); |
|
209 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog/lists'); |
|
210 | 210 | |
211 | 211 | $search = $manager->createSearch(); |
212 | 212 | $expr = array( |
213 | - $search->compare( '==', 'catalog.lists.parentid', array_keys( $items ) ), |
|
214 | - $search->compare( '==', 'catalog.lists.domain', $include ), |
|
213 | + $search->compare('==', 'catalog.lists.parentid', array_keys($items)), |
|
214 | + $search->compare('==', 'catalog.lists.domain', $include), |
|
215 | 215 | ); |
216 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
216 | + $search->setConditions($search->combine('&&', $expr)); |
|
217 | 217 | |
218 | - return $manager->searchItems( $search ); |
|
218 | + return $manager->searchItems($search); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -226,32 +226,32 @@ discard block |
||
226 | 226 | * @param \stdClass $entry Object including "id" and "attributes" elements |
227 | 227 | * @return \Aimeos\MShop\Common\Item\Iface New or updated item |
228 | 228 | */ |
229 | - protected function saveEntry( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry ) |
|
229 | + protected function saveEntry(\Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry) |
|
230 | 230 | { |
231 | - $targetId = ( isset( $entry->targetid ) ? $entry->targetid : null ); |
|
232 | - $refId = ( isset( $entry->refid ) ? $entry->refid : null ); |
|
231 | + $targetId = (isset($entry->targetid) ? $entry->targetid : null); |
|
232 | + $refId = (isset($entry->refid) ? $entry->refid : null); |
|
233 | 233 | |
234 | - if( isset( $entry->id ) ) |
|
234 | + if (isset($entry->id)) |
|
235 | 235 | { |
236 | - $item = $manager->getItem( $entry->id ); |
|
237 | - $item = $this->addItemData( $manager, $item, $entry, $item->getResourceType() ); |
|
238 | - $item = $manager->saveItem( $item ); |
|
236 | + $item = $manager->getItem($entry->id); |
|
237 | + $item = $this->addItemData($manager, $item, $entry, $item->getResourceType()); |
|
238 | + $item = $manager->saveItem($item); |
|
239 | 239 | |
240 | - if( isset( $entry->parentid ) && $targetId !== null ) { |
|
241 | - $manager->moveItem( $item->getId(), $entry->parentid, $targetId, $refId ); |
|
240 | + if (isset($entry->parentid) && $targetId !== null) { |
|
241 | + $manager->moveItem($item->getId(), $entry->parentid, $targetId, $refId); |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | else |
245 | 245 | { |
246 | 246 | $item = $manager->createItem(); |
247 | - $item = $this->addItemData( $manager, $item, $entry, $item->getResourceType() ); |
|
248 | - $manager->insertItem( $item, $targetId, $refId ); |
|
247 | + $item = $this->addItemData($manager, $item, $entry, $item->getResourceType()); |
|
248 | + $manager->insertItem($item, $targetId, $refId); |
|
249 | 249 | } |
250 | 250 | |
251 | - if( isset( $entry->relationships ) ) { |
|
252 | - $this->saveRelationships( $manager, $item, $entry->relationships ); |
|
251 | + if (isset($entry->relationships)) { |
|
252 | + $this->saveRelationships($manager, $item, $entry->relationships); |
|
253 | 253 | } |
254 | 254 | |
255 | - return $manager->getItem( $item->getId() ); |
|
255 | + return $manager->getItem($item->getId()); |
|
256 | 256 | } |
257 | 257 | } |
@@ -107,20 +107,20 @@ discard block |
||
107 | 107 | * @param array $include List of resource types that should be fetched |
108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
109 | 109 | */ |
110 | - protected function getChildItems( array $items, array $include ) |
|
110 | + protected function getChildItems(array $items, array $include) |
|
111 | 111 | { |
112 | 112 | $list = []; |
113 | - $prodIds = array_keys( $items ); |
|
114 | - $include = array_intersect( $include, array( 'product/property' ) ); |
|
113 | + $prodIds = array_keys($items); |
|
114 | + $include = array_intersect($include, array('product/property')); |
|
115 | 115 | |
116 | - foreach( $include as $type ) |
|
116 | + foreach ($include as $type) |
|
117 | 117 | { |
118 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type ); |
|
118 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type); |
|
119 | 119 | |
120 | 120 | $search = $manager->createSearch(); |
121 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $prodIds ) ); |
|
121 | + $search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $prodIds)); |
|
122 | 122 | |
123 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
123 | + $list = array_merge($list, $manager->searchItems($search)); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $list; |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | * @param array $include List of resource types that should be fetched |
135 | 135 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
136 | 136 | */ |
137 | - protected function getListItems( array $items, array $include ) |
|
137 | + protected function getListItems(array $items, array $include) |
|
138 | 138 | { |
139 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' ); |
|
139 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists'); |
|
140 | 140 | |
141 | 141 | $search = $manager->createSearch(); |
142 | 142 | $expr = array( |
143 | - $search->compare( '==', 'product.lists.parentid', array_keys( $items ) ), |
|
144 | - $search->compare( '==', 'product.lists.domain', $include ), |
|
143 | + $search->compare('==', 'product.lists.parentid', array_keys($items)), |
|
144 | + $search->compare('==', 'product.lists.domain', $include), |
|
145 | 145 | ); |
146 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
146 | + $search->setConditions($search->combine('&&', $expr)); |
|
147 | 147 | |
148 | - return $manager->searchItems( $search ); |
|
148 | + return $manager->searchItems($search); |
|
149 | 149 | } |
150 | 150 | } |
@@ -107,20 +107,20 @@ discard block |
||
107 | 107 | * @param array $include List of resource types that should be fetched |
108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
109 | 109 | */ |
110 | - protected function getChildItems( array $items, array $include ) |
|
110 | + protected function getChildItems(array $items, array $include) |
|
111 | 111 | { |
112 | 112 | $list = []; |
113 | - $refIds = array_keys( $items ); |
|
114 | - $include = array_intersect( $include, array( 'customer/address' ) ); |
|
113 | + $refIds = array_keys($items); |
|
114 | + $include = array_intersect($include, array('customer/address')); |
|
115 | 115 | |
116 | - foreach( $include as $type ) |
|
116 | + foreach ($include as $type) |
|
117 | 117 | { |
118 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type ); |
|
118 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type); |
|
119 | 119 | |
120 | 120 | $search = $manager->createSearch(); |
121 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $refIds ) ); |
|
121 | + $search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $refIds)); |
|
122 | 122 | |
123 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
123 | + $list = array_merge($list, $manager->searchItems($search)); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $list; |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | * @param array $include List of resource types that should be fetched |
135 | 135 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
136 | 136 | */ |
137 | - protected function getListItems( array $items, array $include ) |
|
137 | + protected function getListItems(array $items, array $include) |
|
138 | 138 | { |
139 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' ); |
|
139 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists'); |
|
140 | 140 | |
141 | 141 | $search = $manager->createSearch(); |
142 | 142 | $expr = array( |
143 | - $search->compare( '==', 'customer.lists.parentid', array_keys( $items ) ), |
|
144 | - $search->compare( '==', 'customer.lists.domain', $include ), |
|
143 | + $search->compare('==', 'customer.lists.parentid', array_keys($items)), |
|
144 | + $search->compare('==', 'customer.lists.domain', $include), |
|
145 | 145 | ); |
146 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
146 | + $search->setConditions($search->combine('&&', $expr)); |
|
147 | 147 | |
148 | - return $manager->searchItems( $search ); |
|
148 | + return $manager->searchItems($search); |
|
149 | 149 | } |
150 | 150 | } |
@@ -107,20 +107,20 @@ discard block |
||
107 | 107 | * @param array $include List of resource types that should be fetched |
108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
109 | 109 | */ |
110 | - protected function getChildItems( array $items, array $include ) |
|
110 | + protected function getChildItems(array $items, array $include) |
|
111 | 111 | { |
112 | 112 | $list = []; |
113 | - $refIds = array_keys( $items ); |
|
114 | - $include = array_intersect( $include, array( 'supplier/address' ) ); |
|
113 | + $refIds = array_keys($items); |
|
114 | + $include = array_intersect($include, array('supplier/address')); |
|
115 | 115 | |
116 | - foreach( $include as $type ) |
|
116 | + foreach ($include as $type) |
|
117 | 117 | { |
118 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type ); |
|
118 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type); |
|
119 | 119 | |
120 | 120 | $search = $manager->createSearch(); |
121 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $refIds ) ); |
|
121 | + $search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $refIds)); |
|
122 | 122 | |
123 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
123 | + $list = array_merge($list, $manager->searchItems($search)); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $list; |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | * @param array $include List of resource types that should be fetched |
135 | 135 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
136 | 136 | */ |
137 | - protected function getListItems( array $items, array $include ) |
|
137 | + protected function getListItems(array $items, array $include) |
|
138 | 138 | { |
139 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier/lists' ); |
|
139 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier/lists'); |
|
140 | 140 | |
141 | 141 | $search = $manager->createSearch(); |
142 | 142 | $expr = array( |
143 | - $search->compare( '==', 'supplier.lists.parentid', array_keys( $items ) ), |
|
144 | - $search->compare( '==', 'supplier.lists.domain', $include ), |
|
143 | + $search->compare('==', 'supplier.lists.parentid', array_keys($items)), |
|
144 | + $search->compare('==', 'supplier.lists.domain', $include), |
|
145 | 145 | ); |
146 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
146 | + $search->setConditions($search->combine('&&', $expr)); |
|
147 | 147 | |
148 | - return $manager->searchItems( $search ); |
|
148 | + return $manager->searchItems($search); |
|
149 | 149 | } |
150 | 150 | } |