Gdn_DatabaseStructure::query PHP Method

query() public method

Send a query to the database and return the result.
Deprecation: since 2.3. Was incorrectly public. Replaced by executeQuery().
public query ( string $sql, boolean $checkTreshold = false ) : Gdn_Dataset
$sql string The sql to execute.
$checkTreshold boolean Should not be used
return Gdn_Dataset
    public function query($sql, $checkTreshold = false)
    {
        $class = null;
        $internalCall = false;
        // Detect the origin of this call.
        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
        if (count($backtrace) > 1) {
            $class = val('class', $backtrace[1]);
            if ($class) {
                $internalCall = is_a($class, __CLASS__, true);
            }
        }
        // Give appropriate message based on whether we're using it internally.
        if ($internalCall) {
            deprecated("{$class}::query()", "{$class}::executeQuery()");
            return $this->executeQuery($sql, $checkTreshold);
        } else {
            deprecated(__CLASS__ . '::query()', 'Gdn_SQLDriver::query()');
            return $this->Database->query($sql);
        }
    }