. */ /** * Doctrine_Column * This class represents a database column * * @author Konsta Vesterinen * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 */ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Countable { /** * @var array $definition */ protected $_definition = array( 'type' => null, 'length' => 0, ); /** * @var array $definition */ public function __construct(array $definition = array()) { $this->_definition = $definition; } /** * @return array */ public function getDefinition() { return $this->_definition; } /** * contains * * @return boolean */ public function contains($name) { return isset($this->_definition[$name]); } /** * get * * @param string $name * @return mixed */ public function get($name) { if ( ! isset($this->_definition[$name])) { return null; } return $this->_definition[$name]; } /** * set * * @param string $name * @return mixed */ public function set($name, $value) { $this->_definition[$name] = $value; } /** * count * * @return integer */ public function count() { return count($this->_definition); } /** * getIterator * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_definition); } }