Permalink
Browse files

Fixed Relation issue

 * Fixed issue in relation where passthru __call would fail if execute()
returned a non-object
  • Loading branch information...
1 parent 3ecd07b commit 6cbef40d8f77b52003737445f8348e07e7296da9 @vlucas vlucas committed Mar 29, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Spot/Relation/RelationAbstract.php
@@ -150,6 +150,11 @@ public function execute()
*/
public function __call($func, $args)
{
- return call_user_func_array(array($this->execute(), $func), $args);
+ $obj = $this->execute();
+ if(is_object($obj)) {
+ return call_user_func_array(array($obj, $func), $args);
+ } else {
+ return $obj;
+ }
}
}

0 comments on commit 6cbef40

Please sign in to comment.