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.
17 * @subpackage Framework
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Dynamic.php 17517 2009-08-10 13:52:31Z ralph $
24 * @see Zend_Tool_Framework_Metadata_Interface
26 require_once 'Zend/Tool/Framework/Metadata/Interface.php';
31 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
32 * @license http://framework.zend.com/license/new-bsd New BSD License
34 class Zend_Tool_Framework_Metadata_Dynamic
implements Zend_Tool_Framework_Metadata_Interface
40 protected $_type = 'Dynamic';
45 protected $_name = null;
50 protected $_value = null;
55 protected $_dynamicAttributes = array();
60 * The type of metadata this describes
64 public function getType()
76 public function getName()
88 public function getValue()
97 * Check if an attrbute is set
102 public function __isset($name)
104 return isset($this->_dynamicAttributes
[$name]);
110 * @param string $name
113 public function __unset($name)
115 unset($this->_dynamicAttributes
[$name]);
120 * __get() - Get a property via property call $metadata->foo
122 * @param string $name
125 public function __get($name)
127 if (method_exists($this, 'get' . $name)) {
128 return $this->{'get' . $name}();
129 } elseif (array_key_exists($name, $this->_dynamicAttributes
)) {
132 require_once 'Zend/Tool/Framework/Registry/Exception.php';
133 throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this metadata.');
138 * __set() - Set a property via the magic set $metadata->foo = 'foo'
140 * @param string $name
141 * @param mixed $value
143 public function __set($name, $value)
145 if (method_exists($this, 'set' . $name)) {
146 $this->{'set' . $name}($value);
149 require_once 'Zend/Tool/Framework/Registry/Exception.php';
150 throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.');