public function fetchAll($type = null)
    {
        try {
            if ($this->res === false) {
                throw new DatabaseException(__METHOD__ . " No ressource has been given", MySQL::NO_RESSOURCE, MySQL::SEVERITY_DEBUG, __FILE__, __LINE__);
            }

            switch ($type) {
                case MySQL::FETCH_ASSOC:
                    return $this->_db->fetch_assoc_list($this->res);
                    break;
                case MySQL::FETCH_NUM:
                    return $this->_db->fetch_num_list($this->res);
                    break;
                case MySQL::FETCH_OBJ:
                default:
                    return $this->_db->fetch_object_list($this->res);
                    break;
            }
        } catch (DatabaseException $e) {
            throw $e;
        }


    }