Spot\Adapter\PDO\BaseAbstract::query PHP Метод

query() публичный Метод

Find records with custom SQL query
public query ( string $sql, array $binds = [] )
$sql string SQL query to execute
$binds array Array of bound parameters to use as values for query
    public function query($sql, array $binds = array())
    {
        // Add query to log
        \Spot\Log::addQuery($this, $sql, $binds);
        // Prepare and execute query
        if ($stmt = $this->connection()->prepare($sql)) {
            $results = $stmt->execute($binds);
            if ($results) {
                $r = $stmt;
            } else {
                $r = false;
            }
            return $r;
        } else {
            throw new \Spot\Exception(__METHOD__ . " Error: Unable to execute SQL query - failed to create prepared statement from given SQL");
        }
    }