Example #1
0
 /**
  * Returns database object
  *
  * @param int $fetchMode - fetch mode default numeric - 0
  *
  * @throws oxConnectionException error while initiating connection to DB
  *
  * @return oxLegacyDb
  */
 public static function getDb($fetchMode = oxDb::FETCH_MODE_NUM)
 {
     if (self::$_oDB === null) {
         self::$_oDB = static::createDatabase();
     }
     self::$_oDB->setFetchMode($fetchMode);
     return self::$_oDB;
 }