__construct() public method

Constructor.
See also: lithium\data\Connections::add()
See also: lithium\data\source\MongoDb::$_schema
public __construct ( array $config = [] ) : void
$config array Configuration options required to connect to the database, including: - `'database'` _string_: The name of the database to connect to. Defaults to `null`. - `'host'` _string_: The IP or machine name where Mongo is running, followed by a colon, and the port number. Defaults to `'localhost:27017'`. - `'persistent'` _mixed_: Determines a persistent connection to attach to. See the `$options` parameter of [`Mongo::__construct()`](http://php.net/mongo.construct.php) for more information. Defaults to `false`, meaning no persistent connection is made. - `'timeout'` _integer_: The number of milliseconds a connection attempt will wait before timing out and throwing an exception. Defaults to `100`. - `'schema'` _\Closure_: A closure or anonymous function which returns the schema information for a model class. See the `$_schema` property for more information. - `'gridPrefix'` _string_: The default prefix for MongoDB's `chunks` and `files` collections. Defaults to `'fs'`. - `'replicaSet'` _string_: See the documentation for `Mongo::__construct()`. Defaults to `false`. - `'readPreference'` _mixed_: May either be a single value such as Mongo::RP_NEAREST, or an array containing a read preference and a tag set such as: array(Mongo::RP_SECONDARY_PREFERRED, array('dc' => 'east) See the documentation for `Mongo::setReadPreference()`. Defaults to null. Typically, these parameters are set in `Connections::add()`, when adding the adapter to the list of active connections.
return void
 public function __construct(array $config = array())
 {
     $this->_classes['entity'] = 'li3_mongo_embedded\\extensions\\data\\entity\\Document';
     $this->_classes['schema'] = 'li3_mongo_embedded\\extensions\\data\\source\\mongo_db\\Schema';
     $this->_classes['set'] = 'li3_mongo_embedded\\extensions\\data\\collection\\DocumentSet';
     parent::__construct($config);
     $this->_readEmbeddedFilter();
 }
 public function __construct(array $config = array())
 {
     parent::__construct($config);
     $this->_readEmbeddedFilter();
 }
Esempio n. 3
0
 public function __construct($connection)
 {
     parent::__construct(array('autoConnect' => false));
     $this->connection = $connection->connection;
     $this->_isConnected = true;
 }