getMDB() public static method

public static getMDB ( )
 /**
  * @param $name
  * @param $args
  * @return mixed
  * @throws \Exception
  */
 public function __call($name, $args)
 {
     if (!in_array($name, self::$ALLOWED_METHODS)) {
         throw new \Exception(sprintf('The method "%s" is not allowed.', $name));
     }
     $this->connect();
     $result = call_user_func_array(array(\DB::getMDB(), $name), $args);
     $this->disconnect();
     return $result;
 }
Esempio n. 2
0
 public static function transactionDepth()
 {
     $args = func_get_args();
     return call_user_func_array(array(DB::getMDB(), 'transactionDepth'), $args);
 }
 function __construct($type, $mdb = null)
 {
     $type = strtolower($type);
     if ($type != 'or' && $type != 'and') {
         DB::nonSQLError('you must use either WhereClause(and) or WhereClause(or)');
     }
     $this->type = $type;
     if ($mdb === null) {
         $this->mdb = DB::getMDB();
     } else {
         if ($mdb instanceof MeekroDB) {
             $this->mdb = $mdb;
         } else {
             DB::nonSQLError('the second argument to new WhereClause() must be an instance of class MeekroDB');
         }
     }
 }
Esempio n. 4
0
 public static function __callStatic($name, $args)
 {
     return call_user_func_array([DB::getMDB(), $name], $args);
 }