diff --git a/include/class.orm.php b/include/class.orm.php index b784b6341e71df002a2f8bc136f12da32d7f5f0d..c234c55693eee0a7ba2779951dd2e9db1cb8e2a8 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -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)) {