本文整理汇总了PHP中MongoDB::getDBRef方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoDB::getDBRef方法的具体用法?PHP MongoDB::getDBRef怎么用?PHP MongoDB::getDBRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoDB
的用法示例。
在下文中一共展示了MongoDB::getDBRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetDBRef
public function testGetDBRef()
{
$c = $this->object->selectCollection('foo');
$c->drop();
for ($i = 0; $i < 50; $i++) {
$c->insert(array('x' => rand()));
}
$obj = $c->findOne();
$ref = $this->object->createDBRef('foo', $obj);
$obj2 = $this->object->getDBRef($ref);
$this->assertNotNull($obj2);
$this->assertEquals($obj['x'], $obj2['x']);
}
示例2: fetchByDbRef
/**
* Retrieves the contents of the specified $dbRef
* and assigns them into $object
*
* @param Morph_Object $object
* @param array $dbRef
* @return Morph_Object
*/
public function fetchByDbRef(Object $object, array $dbRef)
{
$data = $this->db->getDBRef($dbRef);
return $this->setData($object, $data);
}
示例3: getDBRef
/**
* Fetches the document pointed to by a database reference
*
* @link http://www.php.net/manual/en/mongocollection.getdbref.php
* @param array $ref A database reference.
* @return array Returns the database document pointed to by the reference.
*/
public function getDBRef(array $ref)
{
return $this->db->getDBRef($ref);
}
示例4: getDBRef
/**
* getDBRef.
*/
public function getDBRef($ref)
{
$this->time->start();
$return = parent::getDBRef($ref);
$time = $this->time->stop();
$this->log(array('type' => 'getDBRef', 'ref' => $ref, 'time' => $time));
return $return;
}