예제 #1
0
 /**
  * Returns the instance of the PDO database connection
  *
  * @return PDO the instance of the PDO database connection
  */
 public static final function getInstance()
 {
     if (!self::$_instance instanceof PDO) {
         self::$_instance = new Primitus_DB_DO(self::DB_DSN, self::DB_USERNAME, self::DB_PASSWORD);
         self::$_instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         self::$_instance->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Primitus_DB_Stmt', array()));
     }
     return self::$_instance;
 }
예제 #2
0
 /**
  * Returns the instance of the Primitus_DB() object
  *
  * @return Primitus_DB The database instance
  */
 protected final function DB()
 {
     return Primitus_DB::getInstance();
 }