ServiceEntityAbstract.php 2.1 KB

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