1 | <?php |
||
22 | class Di |
||
23 | { |
||
24 | /** |
||
25 | * The Pimple DI Container object |
||
26 | * |
||
27 | * @var \Pimple\Container |
||
28 | */ |
||
29 | protected $container = null; |
||
30 | |||
31 | public function __construct() |
||
36 | |||
37 | /** |
||
38 | * Sets the DI Container object |
||
39 | * |
||
40 | * @param \Pimple\Container $container |
||
41 | */ |
||
42 | public function setContainer(\Pimple\Container $container) |
||
47 | |||
48 | /** |
||
49 | * Returns an instance of the DI Container |
||
50 | * |
||
51 | * @return \Pimple\Container |
||
52 | */ |
||
53 | public function getContainer() |
||
57 | |||
58 | /** |
||
59 | * Sets a new service outside of the bootstrap object |
||
60 | * |
||
61 | * @param string $name |
||
62 | * The name of the new service |
||
63 | * @param \Closure $function |
||
64 | * The Closure to execute when the service is called |
||
65 | * @return \JaegerApp\Bootstrap |
||
66 | */ |
||
67 | public function setService($name, \Closure $function) |
||
72 | |||
73 | /** |
||
74 | * Returns a single service |
||
75 | * @param string $service The name of the service we want |
||
76 | * @return \Pimple\Container |
||
77 | */ |
||
78 | public function getService($service) |
||
84 | |||
85 | /** |
||
86 | * Sets up and returns all the objects we'll use |
||
87 | * |
||
88 | * @return \Pimple\Container |
||
89 | */ |
||
90 | public function getServices() |
||
94 | } |