Completed
Push — master ( 474f8e...70b418 )
by Aimeos
01:42
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createController() 0 4 1
A setCache() 0 4 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2013
6
 * @copyright Aimeos (aimeos.org), 2015-2018
7
 * @package MShop
8
 */
9
10
11
namespace Aimeos\Controller\Frontend;
12
13
14
/**
15
 * Factory which can create all Frontend controllers.
16
 *
17
 * @package \Aimeos\Controller\Frontend
18
 */
19
class Factory extends \Aimeos\Controller\Frontend
20
{
21
	/**
22
	 * Creates the required controller specified by the given path of controller names.
23
	 *
24
	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object required by managers
25
	 * @param string $path Name of the domain (and sub-managers) separated by slashes, e.g "basket"
26
	 * @return \Aimeos\Controller\Frontend\Iface New frontend controller
27
	 * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found
28
	 */
29
	static public function createController( \Aimeos\MShop\Context\Item\Iface $context, $path )
30
	{
31
		return self::create( $context, $path );
32
	}
33
34
35
	/**
36
	 * Enables or disables caching of class instances.
37
	 *
38
	 * @param boolean $value True to enable caching, false to disable it.
39
	 * @return boolean Previous cache setting
40
	 */
41
	static public function setCache( $value )
42
	{
43
		return self::cache( $value );
44
	}
45
}
46