ConfigurationObjectBaseAbstract.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_Service_WindowsAzure
  17. * @subpackage Diagnostics
  18. * @copyright Copyright (c) 2005-2010 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. * @see Zend_Service_WindowsAzure_Diagnostics_Exception
  24. */
  25. require_once 'Zend/Service/WindowsAzure/Diagnostics/Exception.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Service_WindowsAzure
  29. * @subpackage Diagnostics
  30. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. abstract class Zend_Service_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
  34. {
  35. /**
  36. * Data
  37. *
  38. * @var array
  39. */
  40. protected $_data = null;
  41. /**
  42. * Magic overload for setting properties
  43. *
  44. * @param string $name Name of the property
  45. * @param string $value Value to set
  46. */
  47. public function __set($name, $value) {
  48. if (array_key_exists(strtolower($name), $this->_data)) {
  49. $this->_data[strtolower($name)] = $value;
  50. return;
  51. }
  52. throw new Zend_Service_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
  53. }
  54. /**
  55. * Magic overload for getting properties
  56. *
  57. * @param string $name Name of the property
  58. */
  59. public function __get($name) {
  60. if (array_key_exists(strtolower($name), $this->_data)) {
  61. return $this->_data[strtolower($name)];
  62. }
  63. throw new Zend_Service_WindowsAzure_Diagnostics_Exception("Unknown property: " . $name);
  64. }
  65. }