. */ /** * @package Doctrine * @url http://www.phpdoctrine.com * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @author Jukka Hassinen * @version $Id$ */ /** * class Doctrine_Schema_Column * Holds information on a database table field */ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorAggregate { /** * column definitions * @var array $definition */ protected $definition = array('name' => '', 'type' => '', 'unique' => false, 'primary' => false, 'notnull' => false, 'default' => null, ); public function __construct(array $definition) { foreach($this->definition as $key => $val) { if(isset($definition[$key])) $this->definition[$key] = $definition[$key]; } } public function getName() { return $this->definition['name']; } public function getType() { return $this->definition['type']; } public function isUnique() { return $this->definition['unique']; } public function isPrimaryKey() { return $this->definition['primary']; } public function defaultValue() { return $this->definition['default']; } public function isNotNull() { return $this->definition['notnull']; } }