Skip to content
Snippets Groups Projects
Commit 55dc25ac authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #3090 from protich/issue/orm-queryset

orm: Delegate ResultSet calls to QuerySet Iterator
parents b92b9ed4 393a7d22
No related branches found
No related tags found
No related merge requests found
......@@ -1310,6 +1310,16 @@ class QuerySet implements IteratorAggregate, ArrayAccess, Serializable, Countabl
unset($this->count);
}
function __call($name, $args) {
if (!is_callable(array($this->getIterator(), $name)))
throw new OrmException('Call to undefined method QuerySet::'.$name);
return $args
? call_user_func_array(array($this->getIterator(), $name), $args)
: call_user_func(array($this->getIterator(), $name));
}
// IteratorAggregate interface
function getIterator($iterator=false) {
if (!isset($this->_iterator)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment