1: <?php
2:
3: /**
4: * This file is part of the Nette Framework.
5: *
6: * Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
7: *
8: * This source file is subject to the "Nette license", and/or
9: * GPL license. For more information please see http://nette.org
10: * @package Nette
11: */
12:
13:
14:
15: /**
16: * The dependency injection container.
17: *
18: * @author David Grudl
19: */
20: interface IContext
21: {
22:
23: /**
24: * Adds the specified service to the service container.
25: * @param string service name
26: * @param mixed object, class name or factory callback
27: * @param bool is singleton?
28: * @param array factory options
29: * @return void
30: */
31: function addService($name, $service, $singleton = TRUE, array $options = NULL);
32:
33: /**
34: * Gets the service object of the specified type.
35: * @param string service name
36: * @param array options in case service is not singleton
37: * @return mixed
38: */
39: function getService($name, array $options = NULL);
40:
41: /**
42: * Removes the specified service type from the service container.
43: * @return void
44: */
45: function removeService($name);
46:
47: /**
48: * Exists the service?
49: * @return bool
50: */
51: function hasService($name);
52:
53: }
54: