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  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * The service locator.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette
  20. 20:  */
  21. 21: interface IServiceLocator
  22. 22: {
  23. 23:  
  24. 24:     /**
  25. 25:      * Adds the specified service to the service container.
  26. 26:      * @param  string service name
  27. 27:      * @param  mixed  object, class name or factory callback
  28. 28:      * @param  bool   is singleton?
  29. 29:      * @param  array  factory options
  30. 30:      * @return void 
  31. 31:      */
  32. 32:     function addService($name$service$singleton TRUEarray $options NULL);
  33. 33:  
  34. 34:     /**
  35. 24: /**
  36. 25:      * Gets the service object of the specified type.
  37. 26:      * @param  string service name
  38. 27:      * @param  array  options in case service is not singleton
  39. 28:      * @return mixed 
  40. 39:      */
  41. 40:     function getService($namearray $options NULL);
  42. 41:  
  43. 42:     /**
  44. 24: /**
  45. 25:      * Removes the specified service type from the service container.
  46. 26:      * @return void 
  47. 45:      */
  48. 46:     function removeService($name);
  49. 47:  
  50. 48:     /**
  51. 49:      * Exists the service?
  52. 50:      * @return bool 
  53. 51:      */
  54. 52:     function hasService($name);
  55. 53:  
  56. 54: }