Пример #1
0
 protected function __construct($collection)
 {
     $this->collection = $collection;
     if (isset(\Config::$mongo)) {
         $this->mongo = CConnMgr::getInstance()->mongo(\Config::$mongo);
     }
 }
Пример #2
0
 protected function __construct($table, $pk = 'id')
 {
     $this->table = $table;
     $this->pk = $pk;
     if (isset(\Config::$db)) {
         $this->pdo = CConnMgr::getInstance()->pdo(\Config::$db);
     }
 }
Пример #3
0
 public function __construct($prefix, $redis = null)
 {
     $this->prefix = $prefix;
     if ($redis == null) {
         $this->redis = CConnMgr::getInstance()->redis(\Config::$cache['redis']);
     } else {
         $this->redis = $redis;
     }
 }
Пример #4
0
 public function __construct($prefix, $memcached = null)
 {
     $this->prefix = $prefix;
     if ($memcached == null) {
         $this->memcached = CConnMgr::getInstance()->mem(\Config::$cache['memcache']);
     } else {
         $this->memcached = $memcached;
     }
 }