StorageEntityAbstract.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 Storage
  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_Exception
  24. */
  25. require_once 'Zend/Service/WindowsAzure/Exception.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Service_WindowsAzure
  29. * @subpackage Storage
  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. */
  34. abstract class Zend_Service_WindowsAzure_Storage_StorageEntityAbstract
  35. {
  36. /**
  37. * Data
  38. *
  39. * @var array
  40. */
  41. protected $_data = null;
  42. /**
  43. * Magic overload for setting properties
  44. *
  45. * @param string $name Name of the property
  46. * @param string $value Value to set
  47. */
  48. public function __set($name, $value) {
  49. if (array_key_exists(strtolower($name), $this->_data)) {
  50. $this->_data[strtolower($name)] = $value;
  51. return;
  52. }
  53. throw new Exception("Unknown property: " . $name);
  54. }
  55. /**
  56. * Magic overload for getting properties
  57. *
  58. * @param string $name Name of the property
  59. */
  60. public function __get($name) {
  61. if (array_key_exists(strtolower($name), $this->_data)) {
  62. return $this->_data[strtolower($name)];
  63. }
  64. throw new Exception("Unknown property: " . $name);
  65. }
  66. }