DB\Mongo\Mapper::__construct PHP Метод

__construct() публичный Метод

Instantiate class
public __construct ( Mongo $db, $collection, $fields = NULL ) : void
$db DB\Mongo object
$collection string
$fields array
Результат void
    function __construct(\DB\Mongo $db, $collection, $fields = NULL)
    {
        $this->db = $db;
        $this->collection = $db->selectcollection($collection);
        $this->fields = $fields;
        $this->reset();
    }

Usage Example

Пример #1
0
 public function __construct($collection = null)
 {
     $db = Base::instance()->get($this->connection);
     parent::__construct($db, $collection ?: $this->collection);
 }