diff --git a/include/class.orm.php b/include/class.orm.php index 162b61f46a1f1620e4dbaef1d39f75c71ebc04a8..b784b6341e71df002a2f8bc136f12da32d7f5f0d 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -1904,14 +1904,13 @@ extends ModelResultSet { } /** - * Slight edit to the standard ::next() iteration method which will skip - * deleted items. + * Slight edit to the standard iteration method which will skip deleted + * items. */ - function next() { - do { - parent::next(); - } - while ($this->valid() && $this->current()->__deleted__); + function getIterator() { + return new CallbackFilterIterator(parent::getIterator(), + function($i) { return !$i->__deleted__; } + ); } /**