/** * @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; }
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'); } } }
public static function __callStatic($name, $args) { return call_user_func_array([DB::getMDB(), $name], $args); }