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