RedBeanPHP\Facade::query PHP Method

query() private static method

Internal Query function, executes the desired query. Used by all facade query functions. This keeps things DRY.
private static query ( string $method, string $sql, array $bindings ) : array
$method string desired query method (i.e. 'cell', 'col', 'exec' etc..)
$sql string the sql you want to execute
$bindings array array of values to be bound to query statement
return array
    private static function query($method, $sql, $bindings)
    {
        if (!self::$redbean->isFrozen()) {
            try {
                $rs = Facade::$adapter->{$method}($sql, $bindings);
            } catch (SQLException $exception) {
                if (self::$writer->sqlStateIn($exception->getSQLState(), array(QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN, QueryWriter::C_SQLSTATE_NO_SUCH_TABLE))) {
                    return $method === 'getCell' ? NULL : array();
                } else {
                    throw $exception;
                }
            }
            return $rs;
        } else {
            return Facade::$adapter->{$method}($sql, $bindings);
        }
    }