1 | <?php |
||
18 | class Frontend |
||
19 | { |
||
20 | static private $cache = true; |
||
21 | static private $controllers = []; |
||
22 | |||
23 | |||
24 | /** |
||
25 | * Enables or disables caching of class instances |
||
26 | * |
||
27 | * @param boolean $value True to enable caching, false to disable it. |
||
28 | * @return boolean Previous cache setting |
||
29 | */ |
||
30 | static public function cache( $value ) |
||
37 | |||
38 | |||
39 | /** |
||
40 | * Removes all controller objects from the cache |
||
41 | * |
||
42 | * If neither a context ID nor a path is given, the complete cache will be pruned. |
||
43 | * |
||
44 | * @param integer $id Context ID the objects have been created with (string of \Aimeos\MShop\Context\Item\Iface) |
||
45 | * @param string $path Path describing the controller to clear, e.g. "basket" |
||
46 | */ |
||
47 | static public function clear( $id = null, $path = null ) |
||
62 | |||
63 | |||
64 | /** |
||
65 | * Creates the required controller specified by the given path of controller names |
||
66 | * |
||
67 | * Controllers are created by providing only the domain name, e.g. |
||
68 | * "basket" for the \Aimeos\Controller\Frontend\Basket\Standard or a path of names to |
||
69 | * retrieve a specific sub-controller if available. |
||
70 | * Please note, that only the default controllers can be created. If you need |
||
71 | * a specific implementation, you need to use the factory class of the |
||
72 | * controller to hand over specifc implementation names. |
||
73 | * |
||
74 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object required by managers |
||
75 | * @param string $path Name of the domain (and sub-managers) separated by slashes, e.g "basket" |
||
76 | * @return \Aimeos\Controller\Frontend\Iface New frontend controller |
||
77 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
||
78 | */ |
||
79 | static public function create( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
||
117 | } |
||
118 |