本文整理匯總了PHP中MongoDB::createDBRef方法的典型用法代碼示例。如果您正苦於以下問題:PHP MongoDB::createDBRef方法的具體用法?PHP MongoDB::createDBRef怎麽用?PHP MongoDB::createDBRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MongoDB
的用法示例。
在下文中一共展示了MongoDB::createDBRef方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createDBRef
/**
* createDbRef.
*/
public function createDBRef($collection, $a)
{
$this->time->start();
$return = parent::createDBRef($collection, $a);
$time = $this->time->stop();
$this->log(array('type' => 'createDBRef', 'collection' => $collection, 'a' => $a, 'time' => $time));
return $return;
}
示例2: testIsRef
public function testIsRef() {
$this->assertFalse(MongoDBRef::isRef(array()));
$this->assertFalse(MongoDBRef::isRef(array('$ns' => 'foo', '$id' => 'bar')));
$ref = $this->object->createDBRef('foo.bar', array('foo' => 'bar'));
$this->assertEquals(NULL, $ref);
$ref = array('$ref' => 'blog.posts', '$id' => new MongoId('cb37544b9dc71e4ac3116c00'));
$this->assertTrue(MongoDBRef::isRef($ref));
}
示例3: createDBRef
/**
* Wrapper method for MongoDB::createDBRef().
*
* @see http://php.net/manual/en/mongodb.createdbref.php
* @param string $collection
* @param mixed $a
* @return array
*/
public function createDBRef($collection, $a)
{
return $this->mongoDB->createDBRef($collection, $a);
}