fetch one row, return object

@param string $sql
@return object
769131
function fetch_object($sql)
    {
        $rs   = $this->query($sql);
        $data = $rs->fetch_object();

        $rs->free(); //释放内存
        return $data;
    }
1253861
public function query($sql)
    {
        $this->useConfiguredDatabase();
        $return = $this->getDbConnection()->query($sql);
        $this->checkForDatabaseError($sql, 'query');
        return $return;
    }
1302558
public function fetch_objects($sql)
    {
        $data = [];
        $result = $this->fetch_arrays($sql);
        foreach ($result as $v) {
            $data[] = (object)$v;
        }

        return $data;
    }
481564
final public static function findBySql (string $sql) : array
	{
        $dbObject 		= Database::getInstance();
		$resultSet 		= $dbObject->query($sql);
		$objectArray 	= [];
		while ($row = Database::fetchAssoc($resultSet))
		{
			$objectArray[] = static::instantiate($row);
		}
		return $objectArray;
	}
963217
public function query($sql)
    {
        $result = $this->pdo->query($sql);
        $this->executed[] = $sql;
        return $result;
    }
496499
public function fetchRow($sql, array $parameters = [], $indexedKeys = false)
    {
        $statement = $this->executeQuery($sql, $parameters);

        return $statement->fetch($indexedKeys ? PDO::FETCH_NUM : PDO::FETCH_ASSOC);
    }
499102
function fetch() {

        $this->execute();

        list( $index, $row ) = each( $this->rows );

        return $row;

    }
581791
protected function query($sql) {
		$this->sqlCnt++;
		$res = $this->db->query($sql);
		if (!$res) {
			$this->dbError = $this->db->error;
		}
		return $res;
	}
1358744
protected function query_row ( $sql )
    {
        $sql = $this->sql_printf(func_get_args());
        if (!($res = pg_query($this->conn, $sql)))
        {
            $this->sql_errcheck($sql);
        }
        if ($row = pg_fetch_array($res))
        {
            $rs = $row;
        }
        else
        {
            $rs = false;
        }
        pg_free_result($res);
        return $rs;
    }
594384
public function getRow($sql, $params = null)
    {
        return $this->_socket->getRow($sql, $params = null);
    }
826061
public function fetch_array($sql)
    {
        $rs   = $this->query($sql);
        $data = mysql_fetch_assoc($rs);
        if (empty($data)) {
            $data = [];
        }

        mysql_free_result($rs);
        return $data;
    }
170953
protected function query_one ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		if (!($res = mysql_query($sql, $this->conn)))
		{
			$this->sql_errcheck($sql);
		}
		$val = @mysql_result($res, 0, 0);
		mysql_free_result($res);
		return $val;
	}
224452
public function select($sql, $parameters = array()) {
		if ($this->configs['result_type'] == 'object'
            || $this->configs['result_type'] == '{}'
            || $this->configs['result_type'] === true) {
            return $this->getObject($sql, $parameters);
        }
        return $this->getArray($sql, $parameters);
	}
829512
function fetch_arrays($sql)
    {
        $rs   = $this->query($sql);
        $data = [];
        while (true == ($row = $rs->fetch_assoc())) {
            $data[] = $row;
        }
        $rs->free();
        return $data;
    }
1274756
function fetch_objects($sql)
    {
        $rs   = $this->query($sql);
        $data = null;
        while (true == ($row = $rs->fetch_object())) {
            $data[] = $row;
        }
        $rs->free();
        return $data;
    }
244804
function get_object($sql, $class_name = 'stdClass', array $params = null)
	{
		$rs = $this->query($sql, MYSQLI_USE_RESULT);
		$obj = is_null($params) ? $rs->fetch_object($class_name) : $rs->fetch_object($class_name, $params);
		$rs->free_result();
		return $obj;
	}
974069
public function getFirst($sql = null)
    {
        $result = $this->builder->getFirst($sql);

        if (isset($result[0])) {
            return self::instance($result[0]);
        }

        return null;
    }