本文整理汇总了PHP中MongoClient::_getProtocol方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoClient::_getProtocol方法的具体用法?PHP MongoClient::_getProtocol怎么用?PHP MongoClient::_getProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoClient
的用法示例。
在下文中一共展示了MongoClient::_getProtocol方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Creates a new collection
*
* @param MongoDB $db - Parent database.
* @param string $name -
*
* @return - Returns a new collection object.
*/
public function __construct(MongoDB $db, $name)
{
$this->db = $db;
$this->name = $name;
$this->fqn = $db->_getFullCollectionName($name);
$this->client = $db->_getClient();
$this->protocol = $this->client->_getProtocol();
}
示例2: __construct
/**
* Create a new cursor
*
* @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.
*
* @return - Returns the new cursor.
*/
public function __construct(MongoClient $connection, $ns, array $query = [], array $fields = [])
{
$this->client = $connection;
$this->protocol = $connection->_getProtocol();
$this->fcn = $ns;
$this->fields = $fields;
$this->query['$query'] = $query;
$this->queryTimeout = self::$timeout;
}
示例3: __construct
/**
* Creates a new database
*
* @param mongoclient $conn - Database connection.
* @param string $name - Database name.
*
* @return - Returns the database.
*/
public function __construct(MongoClient $client, $name)
{
$this->name = $name;
$this->client = $client;
$this->protocol = $client->_getProtocol();
}