protected function _operatorCallable($name)
    {
        $operator = $this->config("operators.{$name}");

        if ($operator) {
            $handler = $operator['handler'];

            if (is_callable($handler)) {
                return function ($query, $token) use ($handler) {
                    return $handler($query, $token);
                };
            } elseif ($handler instanceof BaseOperator) {
                return function ($query, $token) use ($handler) {
                    return $handler->scope($query, $token);
                };
            } elseif (is_string($handler) && method_exists($this->_table, $handler)) {
                return function ($query, $token) use ($handler) {
                    return $this->_table->$handler($query, $token);
                };
            } elseif (is_string($handler) && is_subclass_of($handler, '\Search\Operator\BaseOperator')) {
                return function ($query, $token) use ($operator) {
                    $instance = new $operator['handler']($this->_table, $operator['options']);

                    return $instance->scope($query, $token);
                };
            }
        }

        return false;
    }
protected function _operatorCallable($name)
    {
        $operator = $this->config("operators.{$name}");

        if ($operator) {
            $handler = $operator['handler'];

            if (is_callable($handler)) {
                return function ($query, $token) use ($handler) {
                    return $handler($query, $token);
                };
            } elseif ($handler instanceof BaseOperator) {
                return function ($query, $token) use ($handler) {
                    return $handler->scope($query, $token);
                };
            } elseif (is_string($handler) && method_exists($this->_table, $handler)) {
                return function ($query, $token) use ($handler) {
                    return $this->_table->$handler($query, $token);
                };
            } elseif (is_string($handler) && is_subclass_of($handler, '\Search\Operator\BaseOperator')) {
                return function ($query, $token) use ($operator) {
                    $instance = new $operator['handler']($this->_table, $operator['options']);

                    return $instance->scope($query, $token);
                };
            }
        }

        return false;
    }
protected function _operatorCallable ( $ name ) { $ operator = $ this -> config ( "operators.{$name}" ) ; if ( $ operator ) { $ handler = $ operator [ 'handler' ] ; if ( is_callable ( $ handler ) ) { return function ( $ query , $ token ) use ( $ handler ) { return $ handler ( $ query , $ token ) ; } ; } elseif ( $ handler instanceof BaseOperator ) { return function ( $ query , $ token ) use ( $ handler ) { return $ handler -> scope ( $ query , $ token ) ; } ; } elseif ( is_string ( $ handler ) && method_exists ( $ this -> _table , $ handler ) ) { return function ( $ query , $ token ) use ( $ handler ) { return $ this -> _table -> $ handler ( $ query , $ token ) ; } ; } elseif ( is_string ( $ handler ) && is_subclass_of ( $ handler , '\Search\Operator\BaseOperator' ) ) { return function ( $ query , $ token ) use ( $ operator ) { $ instance = new $ operator [ 'handler' ] ( $ this -> _table , $ operator [ 'options' ] ) ; return $ instance -> scope ( $ query , $ token ) ; } ; } } return false ; }
Gets the callable method for a given operator method.

@param string $name Name of the method to get
@return bool|callable False if no callback was found for the given operator
name. Or the callable if found.
Gets the callable method for a given operator method .