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