1 | <?php |
||
8 | abstract class Surrogate |
||
9 | { |
||
10 | /** |
||
11 | * The application instance. |
||
12 | * |
||
13 | * @var \Magister\Magister |
||
14 | */ |
||
15 | protected static $app; |
||
16 | |||
17 | /** |
||
18 | * The resolved object instances. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected static $resolvedInstance; |
||
23 | |||
24 | /** |
||
25 | * Resolve the surrogate instance from the container. |
||
26 | * |
||
27 | * @param string $name |
||
28 | * |
||
29 | * @return mixed |
||
30 | */ |
||
31 | protected static function resolveSurrogateInstance($name) |
||
43 | |||
44 | /** |
||
45 | * Get the object behind the surrogate. |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public static function getSurrogateRoot() |
||
53 | |||
54 | /** |
||
55 | * Clear all of the instances. |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | public static function clearResolvedInstances() |
||
63 | |||
64 | /** |
||
65 | * Return the name of the service. |
||
66 | * |
||
67 | * @throws \RuntimeException |
||
68 | * |
||
69 | * @return void |
||
70 | */ |
||
71 | protected static function getSurrogateAccessor() |
||
75 | |||
76 | /** |
||
77 | * Set the application instance. |
||
78 | * |
||
79 | * @param \Magister\Magister $app |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public static function setSurrogateApplication($app) |
||
87 | |||
88 | /** |
||
89 | * Get the application instance. |
||
90 | * |
||
91 | * @return \Magister\Magister |
||
92 | */ |
||
93 | public static function getSurrogateApplication() |
||
97 | |||
98 | /** |
||
99 | * Dynamically handle incoming requests. |
||
100 | * |
||
101 | * @param string $method |
||
102 | * @param array $args |
||
103 | * |
||
104 | * @return mixed |
||
105 | */ |
||
106 | public static function __callStatic($method, $args) |
||
125 | } |
||
126 |