@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param ContainerInterface $container Dependency container |
31 | 31 | */ |
32 | - public function __construct( ContainerInterface $container ) |
|
32 | + public function __construct(ContainerInterface $container) |
|
33 | 33 | { |
34 | 34 | $this->container = $container; |
35 | 35 | } |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | * @param array $attributes Associative list of URL parameter |
43 | 43 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
44 | 44 | */ |
45 | - public function get( \Aimeos\MShop\Context\Item\Iface $context, array $attributes ) |
|
45 | + public function get(\Aimeos\MShop\Context\Item\Iface $context, array $attributes) |
|
46 | 46 | { |
47 | - if( $this->locale === null ) |
|
47 | + if ($this->locale === null) |
|
48 | 48 | { |
49 | - $disableSites = $this->container->get( 'aimeos_config' )->get( 'disableSites', true ); |
|
49 | + $disableSites = $this->container->get('aimeos_config')->get('disableSites', true); |
|
50 | 50 | |
51 | - $site = ( isset( $attributes['site'] ) ? $attributes['site'] : 'default' ); |
|
52 | - $lang = ( isset( $attributes['locale'] ) ? $attributes['locale'] : '' ); |
|
53 | - $currency = ( isset( $attributes['currency'] ) ? $attributes['currency'] : '' ); |
|
51 | + $site = (isset($attributes['site']) ? $attributes['site'] : 'default'); |
|
52 | + $lang = (isset($attributes['locale']) ? $attributes['locale'] : ''); |
|
53 | + $currency = (isset($attributes['currency']) ? $attributes['currency'] : ''); |
|
54 | 54 | |
55 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
56 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
55 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
56 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | return $this->locale; |
@@ -67,21 +67,21 @@ discard block |
||
67 | 67 | * @param string $sitecode Unique site code |
68 | 68 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
69 | 69 | */ |
70 | - public function getBackend( \Aimeos\MShop\Context\Item\Iface $context, $sitecode ) |
|
70 | + public function getBackend(\Aimeos\MShop\Context\Item\Iface $context, $sitecode) |
|
71 | 71 | { |
72 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
72 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
73 | 73 | |
74 | 74 | try |
75 | 75 | { |
76 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
77 | - $localeItem->setLanguageId( null ); |
|
78 | - $localeItem->setCurrencyId( null ); |
|
76 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
77 | + $localeItem->setLanguageId(null); |
|
78 | + $localeItem->setCurrencyId(null); |
|
79 | 79 | } |
80 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
80 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
81 | 81 | { |
82 | - $item = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' )->findItem( $sitecode ); |
|
82 | + $item = \Aimeos\MShop\Factory::createManager($context, 'locale/site')->findItem($sitecode); |
|
83 | 83 | $localeItem = $localeManager->createItem(); |
84 | - $localeItem->setSiteId( $item->getId() ); |
|
84 | + $localeItem->setSiteId($item->getId()); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return $localeItem; |
@@ -76,8 +76,7 @@ |
||
76 | 76 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
77 | 77 | $localeItem->setLanguageId( null ); |
78 | 78 | $localeItem->setCurrencyId( null ); |
79 | - } |
|
80 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
79 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
81 | 80 | { |
82 | 81 | $item = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' )->findItem( $sitecode ); |
83 | 82 | $localeItem = $localeManager->createItem(); |