|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
|
5
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2018 |
|
6
|
|
|
* @package Admin |
|
7
|
|
|
* @subpackage JsonAdm |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
namespace Aimeos\Admin\JsonAdm; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Factory which can create all JSON API clients |
|
16
|
|
|
* |
|
17
|
|
|
* @package Admin |
|
18
|
|
|
* @subpackage JsonAdm |
|
19
|
|
|
* @deprecated Use JsonAdm class instead |
|
20
|
|
|
*/ |
|
21
|
|
|
class Factory |
|
22
|
|
|
extends \Aimeos\Admin\JsonAdm |
|
23
|
|
|
implements \Aimeos\Admin\JsonAdm\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 \Aimeos\Bootstrap $aimeos Aimeos Bootstrap object |
|
30
|
|
|
* @param string $path Name of the client separated by slashes, e.g "product/property" |
|
31
|
|
|
* @param string|null $name Name of the client implementation ("Standard" if null) |
|
32
|
|
|
* @return \Aimeos\Admin\JsonAdm\Iface JSON admin instance |
|
33
|
|
|
* @throws \Aimeos\Admin\JsonAdm\Exception If the given path is invalid |
|
34
|
|
|
*/ |
|
35
|
|
|
static public function create( \Aimeos\MShop\Context\Item\Iface $context, |
|
36
|
|
|
\Aimeos\Bootstrap $aimeos, $path, $name = null ) |
|
37
|
|
|
{ |
|
38
|
|
|
return parent::create( $context, $aimeos, $path, $name ); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Enables or disables caching of class instances. |
|
44
|
|
|
* |
|
45
|
|
|
* @param boolean $value True to enable caching, false to disable it. |
|
46
|
|
|
* @return boolean Previous cache setting |
|
47
|
|
|
*/ |
|
48
|
|
|
static public function setCache( $value ) |
|
49
|
|
|
{ |
|
50
|
|
|
return self::cache( $value ); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|