Resource.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Application
  17. * @subpackage Resource
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * Interface for bootstrap resources
  24. *
  25. * @category Zend
  26. * @package Zend_Application
  27. * @subpackage Resource
  28. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. */
  31. interface Zend_Application_Resource_Resource
  32. {
  33. /**
  34. * Constructor
  35. *
  36. * Must take an optional single argument, $options.
  37. *
  38. * @param mixed $options
  39. */
  40. public function __construct($options = null);
  41. /**
  42. * Set the bootstrap to which the resource is attached
  43. *
  44. * @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
  45. * @return Zend_Application_Resource_Resource
  46. */
  47. public function setBootstrap(Zend_Application_Bootstrap_Bootstrapper $bootstrap);
  48. /**
  49. * Retrieve the bootstrap to which the resource is attached
  50. *
  51. * @return Zend_Application_Bootstrap_Bootstrapper
  52. */
  53. public function getBootstrap();
  54. /**
  55. * Set resource options
  56. *
  57. * @param array $options
  58. * @return Zend_Application_Resource_Resource
  59. */
  60. public function setOptions(array $options);
  61. /**
  62. * Retrieve resource options
  63. *
  64. * @return array
  65. */
  66. public function getOptions();
  67. /**
  68. * Strategy pattern: initialize resource
  69. *
  70. * @return mixed
  71. */
  72. public function init();
  73. }