/** * Constructor * * @param DB_Common $db An instance of a class that extends DB_Common. * * @throws XML_Query2XML_DBException If the fetch mode cannot be set to * DB_FETCHMODE_ASSOC. */ public function __construct(DB_common $db) { $fetchModeError = $db->setFetchMode(DB_FETCHMODE_ASSOC); if (PEAR::isError($fetchModeError)) { // no unit tests for this one throw new XML_Query2XML_DBException('Could not set fetch mode to DB_FETCHMODE_ASSOC: ' . $fetchModeError->toString()); } $this->_db = $db; }