1 | <?php |
||
33 | class Service extends StaticAbstract |
||
34 | { |
||
35 | /** |
||
36 | * @var ContainerInterface |
||
37 | * @access protected |
||
38 | * @staticvar |
||
39 | */ |
||
40 | protected static $container; |
||
41 | |||
42 | /** |
||
43 | * Locate a service from the container |
||
44 | * |
||
45 | * ```php |
||
46 | * // the global config object |
||
47 | * $config = Service::config(); |
||
48 | * |
||
49 | * // the container |
||
50 | * $container = Service::container(); |
||
51 | * ``` |
||
52 | * |
||
53 | * @param string $method object id actually |
||
54 | * @param array $params |
||
55 | * @return object |
||
56 | * @throws NotFoundException if container not set or object not found |
||
57 | * @throws RuntimeException if object instantiation error |
||
58 | * @access public |
||
59 | * @api |
||
60 | */ |
||
61 | public static function __callstatic(/*# string */ $method, array $params) |
||
77 | |||
78 | /** |
||
79 | * Set container |
||
80 | * |
||
81 | * @param ContainerInterface $container |
||
82 | * @access public |
||
83 | * @api |
||
84 | */ |
||
85 | public function setContainer(ContainerInterface $container) |
||
89 | } |
||
90 |