Completed
Push — master ( 649aac...9efee0 )
by Aimeos
01:52
created

Factory::createClientNew()   A

Complexity

Conditions 5
Paths 7

Size

Total Lines 33

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 9.0808
c 0
b 0
f 0
cc 5
nc 7
nop 3
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2018
6
 * @package Client
7
 * @subpackage JsonApi
8
 */
9
10
11
namespace Aimeos\Client\JsonApi;
12
13
14
/**
15
 * Factory which can create all JSON API clients
16
 *
17
 * @package Client
18
 * @subpackage JsonApi
19
 * @deprecated Use JsonApi class instead
20
 */
21
class Factory
22
	extends \Aimeos\Client\JsonApi
23
	implements \Aimeos\Client\JsonApi\Common\Factory\Iface
24
{
25
	/**
26
	 * Creates the required client specified by the given path of client names.
27
	 *
28
	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object required by clients
29
	 * @param string $path Name of the client separated by slashes, e.g "order/base"
30
	 * @param string|null $name Name of the client implementation ("Standard" if null)
31
	 * @return \Aimeos\Client\JsonApi\Iface JSON client instance
32
	 * @throws \Aimeos\Client\JsonApi\Exception If the given path is invalid
33
	 */
34
	static public function createClient( \Aimeos\MShop\Context\Item\Iface $context, $path, $name = null )
35
	{
36
		return self::create( $context, $path, $name );
37
	}
38
39
40
	/**
41
	 * Enables or disables caching of class instances.
42
	 *
43
	 * @param boolean $value True to enable caching, false to disable it.
44
	 * @return boolean Previous cache setting
45
	 */
46
	static public function setCache( $value )
47
	{
48
		return self::cache( $value );
49
	}
50
}
51