LMongo\Eloquent\Builder::__call PHP Method

__call() public method

Dynamically handle calls into the query instance.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed
    public function __call($method, $parameters)
    {
        if (method_exists($this->model, $scope = 'scope' . ucfirst($method))) {
            array_unshift($parameters, $this);
            call_user_func_array(array($this->model, $scope), $parameters);
        } else {
            $result = call_user_func_array(array($this->query, $method), $parameters);
        }
        return in_array($method, $this->passthru) ? $result : $this;
    }