Source for file IServiceLocator.php

Documentation is available at IServiceLocator.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
  7. 7:  *
  8. 8:  * This source file is subject to the "Nette license" that is bundled
  9. 9:  * with this package in the file license.txt.
  10. 10:  *
  11. 11:  * For more information please see https://nette.org
  12. 12:  *
  13. 13:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  14. 14:  * @license    https://nette.org/license  Nette license
  15. 15:  * @link       https://nette.org
  16. 16:  * @category   Nette
  17. 17:  * @package    Nette
  18. 18:  * @version    $Id$
  19. 19:  */
  20. 20:  
  21. 21:  
  22. 22:  
  23. 23: /**
  24. 24:  * The service locator (EXPERIMENTAL).
  25. 25:  *
  26. 26:  * @author     David Grudl
  27. 27:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  28. 28:  * @package    Nette
  29. 29:  */
  30. 30: interface IServiceLocator
  31. 31: {
  32. 32:  
  33. 33:     /**
  34. 34:      * Adds the specified service to the service container.
  35. 35:      * @param  mixed  object, class name or service factory callback
  36. 36:      * @param  string optional service name (for factories is not optional)
  37. 37:      * @param  bool   promote to higher level?
  38. 38:      * @return void 
  39. 39:      */
  40. 40:     function addService($service$name NULL$promote FALSE);
  41. 41:  
  42. 42:     /**
  43. 43:      * Removes the specified service type from the service container.
  44. 44:      * @param  bool   promote to higher level?
  45. 45:      * @return void 
  46. 46:      */
  47. 47:     function removeService($name$promote TRUE);
  48. 48:  
  49. 49:     /**
  50. 50:      * Gets the service object of the specified type.
  51. 51:      * @param  string service name
  52. 52:      * @return mixed 
  53. 53:      */
  54. 54:     function getService($name);
  55. 55:  
  56. 56:     /**
  57. 57:      * Returns the parent container if any.
  58. 58:      * @return IServiceLocator|NULL
  59. 59:      */
  60. 60:     function getParent();
  61. 61: }