public function query($type = 'object')
    {
        $sql = 'select '.$this->columns.' from '.$this->getTables($this->tables).' '.$this->where.' '.$this->order.' '.$this->group;

        static::$sql = static::$register[] = $sql;
        //
        if ($data = Database::read($sql)) {
            return self::fetch($data, $type);
        } elseif (Database::execerr()) {
            throw new QueryException();
        }
    }