改进分页类魔术方法的返回值

This commit is contained in:
yunwuxin
2018-04-24 13:28:43 +08:00
parent a76d656110
commit 4375ea5db7

View File

@@ -395,7 +395,15 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
public function __call($name, $arguments)
{
return call_user_func_array([$this->getCollection(), $name], $arguments);
$collection = $this->getCollection();
$result = call_user_func_array([$collection, $name], $arguments);
if ($result === $collection) {
return $this;
}
return $result;
}
}