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

Create a new cursor
public __construct ( MongoClient $connection, string $ns )
$connection MongoClient Database connection.
$ns string Full name of database and collection.
 /**
  * MongoCommandCursor constructor.
  * @param MongoClient $connection
  * @param string $ns
  * @param array $command
  */
 public function __construct(MongoClient $connection, $ns, array $command = [])
 {
     parent::__construct($connection, $ns);
     $this->command = $command;
 }
Пример #2
0
 /**
  * Create a new cursor
  * @link http://www.php.net/manual/en/mongocursor.construct.php
  * @param MongoClient $connection Database connection.
  * @param string $ns Full name of database and collection.
  * @param array $query Database query.
  * @param array $fields Fields to return.
  */
 public function __construct(MongoClient $connection, $ns, array $query = array(), array $fields = array())
 {
     parent::__construct($connection, $ns);
     $this->query = $query;
     $this->projection = $fields;
 }