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