Resource.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-2012 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-2012 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. * @return void
  40. */
  41. public function __construct($options = null);
  42. /**
  43. * Set the bootstrap to which the resource is attached
  44. *
  45. * @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
  46. * @return Zend_Application_Resource_Resource
  47. */
  48. public function setBootstrap(Zend_Application_Bootstrap_Bootstrapper $bootstrap);
  49. /**
  50. * Retrieve the bootstrap to which the resource is attached
  51. *
  52. * @return Zend_Application_Bootstrap_Bootstrapper
  53. */
  54. public function getBootstrap();
  55. /**
  56. * Set resource options
  57. *
  58. * @param array $options
  59. * @return Zend_Application_Resource_Resource
  60. */
  61. public function setOptions(array $options);
  62. /**
  63. * Retrieve resource options
  64. *
  65. * @return array
  66. */
  67. public function getOptions();
  68. /**
  69. * Strategy pattern: initialize resource
  70. *
  71. * @return mixed
  72. */
  73. public function init();
  74. }