Completed
Push — master ( 2507d2...3b83d2 )
by Aimeos
03:49
created

Languages::setView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016
6
 * @package Admin
7
 * @subpackage JQAdm
8
 */
9
10
11
namespace Aimeos\Admin\JQAdm\Common\Decorator;
12
13
14
/**
15
 * Languages decorator for JQAdm clients
16
 *
17
 * @package Admin
18
 * @subpackage JQAdm
19
 */
20
class Languages extends Base
21
{
22
	/**
23
	 * Sets the view object and adds the available languages
24
	 *
25
	 * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output
26
	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
27
	 */
28
	public function setView( \Aimeos\MW\View\Iface $view )
29
	{
30
		$extdir = dirname( dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) );
31
		$aimeos = new \Aimeos\Bootstrap( array( $extdir ) );
32
33
		$view->languagesList = $aimeos->getI18nList( 'admin' );
34
35
		$this->getClient()->setView( $view );
36
		return $this;
37
	}
38
}
39