From b55ae1fd5e440408dfb75089d81ba77b55126a41 Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 30 Sep 2006 10:24:28 +0000 Subject: [PATCH] --- lib/Doctrine/Collection/Offset.php | 28 +++++++- lib/Doctrine/Iterator.php | 102 ----------------------------- 2 files changed, 26 insertions(+), 104 deletions(-) delete mode 100644 lib/Doctrine/Iterator.php diff --git a/lib/Doctrine/Collection/Offset.php b/lib/Doctrine/Collection/Offset.php index a33a56de7..806b5b6eb 100644 --- a/lib/Doctrine/Collection/Offset.php +++ b/lib/Doctrine/Collection/Offset.php @@ -1,7 +1,31 @@ . + */ +Doctrine::autoload('Doctrine_Collection_Offset'); /** - * Offset Collection + * Doctrine_Collection_Offset + * Collection of Doctrine_Record objects. + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL */ class Doctrine_Collection_Offset extends Doctrine_Collection { /** diff --git a/lib/Doctrine/Iterator.php b/lib/Doctrine/Iterator.php deleted file mode 100644 index e0be4eac2..000000000 --- a/lib/Doctrine/Iterator.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ -/** - * Doctrine_Iterator - * iterates through Doctrine_Collection - * - * @package Doctrine ORM - * @url www.phpdoctrine.com - * @license LGPL - */ -abstract class Doctrine_Iterator implements Iterator { - /** - * @var Doctrine_Collection $collection - */ - protected $collection; - /** - * @var array $keys - */ - protected $keys; - /** - * @var mixed $key - */ - protected $key; - /** - * @var integer $index - */ - protected $index; - /** - * @var integer $count - */ - protected $count; - - /** - * constructor - * @var Doctrine_Collection $collection - */ - public function __construct(Doctrine_Collection $collection) { - $this->collection = $collection; - $this->keys = $this->collection->getKeys(); - $this->count = $this->collection->count(); - } - /** - * rewinds the iterator - * - * @return void - */ - public function rewind() { - $this->index = 0; - $i = $this->index; - if(isset($this->keys[$i])) - $this->key = $this->keys[$i]; - } - - /** - * returns the current key - * - * @return integer - */ - public function key() { - return $this->key; - } - /** - * returns the current record - * - * @return Doctrine_Record - */ - public function current() { - return $this->collection->get($this->key); - } - /** - * advances the internal pointer - * - * @return void - */ - public function next() { - $this->index++; - $i = $this->index; - if(isset($this->keys[$i])) - $this->key = $this->keys[$i]; - } -} - - -