Ejemplo n.º 1
0
 /**
  *
  * @return Mongo
  */
 protected function _get_mongo()
 {
     $instance_name = $this->_mongo_instance_name;
     $config = Mongostar_Model::getConfig()[$instance_name];
     $options = isset($config['options']) ? $config['options'] : array();
     $connection = "mongodb://" . $config['connection']['server'];
     self::$_mongos[$this->_mongo_instance_name] = new MongoClient($connection, $options);
     return self::$_mongos[$this->_mongo_instance_name];
 }
Ejemplo n.º 2
0
 /**
  * @param string $name
  */
 protected function __construct($name)
 {
     $this->_name = $name;
     $this->_config = Mongostar_Model::getConfig()[$name];
 }