1
0
mirror of synced 2025-01-18 22:41:43 +03:00
doctrine2/classes/Iterator/Expandable.class.php
doctrine 88dc397e7c
2006-04-19 20:03:23 +00:00

26 lines
741 B
PHP

<?php
require_once(Doctrine::getPath().DIRECTORY_SEPARATOR."Iterator.class.php");
class Doctrine_Iterator_Expandable extends Doctrine_Iterator {
public function valid() {
if($this->index < $this->count)
return true;
elseif($this->index == $this->count) {
$coll = $this->collection->expand($this->index);
if($coll instanceof Doctrine_Collection) {
$count = count($coll);
if($count > 0) {
$this->keys = array_merge($this->keys, $coll->getKeys());
$this->count += $count;
return true;
}
}
return false;
}
}
}
?>