Example #1
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $object = __CLASS__;
         self::$instance = new $object();
     }
     return self::$instance;
 }
 /**
  * get instance with a user specific database (DefaultDB)
  *
  * @param String $userDb
  * @return Object self
  */
 public static function getInstanceWithUserDB($userDb)
 {
     if (!isset(self::$instance)) {
         $object = __CLASS__;
         self::$instance = new $object();
     }
     self::$instance->dbh->select_db($userDb);
     return self::$instance;
 }