. */ /** * @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_Object * Catches any non-property call from child classes and throws an exception. */ abstract class Doctrine_Schema_Object implements IteratorAggregate, Countable { protected $children = array(); protected $definition = array(); /** * * @return int * @access public */ public function count() { if( ! empty($this->childs)) return count($this->childs); return count($this->definition); } /** * getIterator * * @return ArrayIterator * @access public */ public function getIterator() { if( ! empty($this->childs)) return new ArrayIterator($this->childs); return new ArrayIterator($this->definition); } }