Пример #1
0
 /**
  * Orders to the DbConnectionHandler to create a PDO instance. This function can be used 
  * when two or more connections need to be etablished in the same controller function.
  *
  * @param string $dbInfoKey
  *
  * @throws DbConnectionHandlerException
  * @throws PDOException
  */
 protected function connectDb($dbInfoKey = null)
 {
     try {
         DbConnectionHandler::createPDOInstance($dbInfoKey);
     } catch (DbConnectionHandlerException $e) {
         ExceptionHandler::displayException($e);
     } catch (PDOException $e) {
         ExceptionHandler::displayException($e);
     }
 }
Пример #2
0
 /**
  * Gets the PDO instance of the DbConnectionHandler.
  */
 private static function getPDO()
 {
     self::$pdo = DbConnectionHandler::getPDO();
     return self::$pdo;
 }