1 | <?php |
||
18 | abstract class Facade |
||
19 | { |
||
20 | /** |
||
21 | * Facaded component property accessors. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | private static $_accessors = []; |
||
26 | |||
27 | /** |
||
28 | * The facaded application. |
||
29 | * |
||
30 | * @var Application |
||
31 | */ |
||
32 | private static $_app; |
||
33 | |||
34 | /** |
||
35 | * Facaded components. |
||
36 | * |
||
37 | * @var object[] |
||
38 | */ |
||
39 | private static $_components = []; |
||
40 | |||
41 | /** |
||
42 | * Prevents the class to be instantiated. |
||
43 | */ |
||
44 | private function __construct() |
||
47 | |||
48 | /** |
||
49 | * Prevents the class to be serialized. |
||
50 | */ |
||
51 | private function __wakeup() |
||
54 | |||
55 | /** |
||
56 | * Prevents the class to be cloned. |
||
57 | */ |
||
58 | private function __clone() |
||
61 | |||
62 | /** |
||
63 | * Redirects static calls to component instance calls. |
||
64 | * |
||
65 | * @inheritDoc |
||
66 | */ |
||
67 | 11 | public static function __callStatic($name, $arguments) |
|
94 | |||
95 | /** |
||
96 | * Clears a resolved facade component. |
||
97 | * |
||
98 | * @param string $id |
||
99 | */ |
||
100 | 1 | public static function clearResolvedFacadeComponent($id) |
|
104 | |||
105 | /** |
||
106 | * Clears all resolved facade components. |
||
107 | */ |
||
108 | 16 | public static function clearResolvedFacadeComponents() |
|
113 | |||
114 | /** |
||
115 | * Returns a component ID being facaded. |
||
116 | * |
||
117 | * @return string |
||
118 | * @throws \yii\base\InvalidConfigException |
||
119 | */ |
||
120 | 1 | public static function getFacadeComponentId() |
|
124 | |||
125 | /** |
||
126 | * Returns a component being facaded. |
||
127 | * |
||
128 | * @return object |
||
129 | */ |
||
130 | 12 | public static function getFacadeComponent() |
|
138 | |||
139 | /** |
||
140 | * Returns the facaded application. |
||
141 | * |
||
142 | * @return Application |
||
143 | */ |
||
144 | 13 | public static function getFacadeApplication() |
|
151 | |||
152 | /** |
||
153 | * Sets the facaded application. |
||
154 | * |
||
155 | * @param Application $value |
||
156 | */ |
||
157 | 16 | public static function setFacadeApplication(Application $value) |
|
162 | } |
||
163 |