本文整理匯總了PHP中Doctrine\ODM\MongoDB\Mapping\ClassMetadata::getDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadata::getDB方法的具體用法?PHP ClassMetadata::getDB怎麽用?PHP ClassMetadata::getDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ODM\MongoDB\Mapping\ClassMetadata
的用法示例。
在下文中一共展示了ClassMetadata::getDB方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareDocReference
/**
* Returns the reference representation to be stored in mongodb or null if not applicable.
*
* @param ClassMetadata $class
* @param Document $doc
* @return array|null
*/
private function _prepareDocReference(ClassMetadata $class, $doc)
{
if (!is_object($doc)) {
return $doc;
}
$id = $this->_uow->getDocumentIdentifier($doc);
$ref = array('$ref' => $class->getCollection(), '$id' => $id, '$db' => $class->getDB());
return $ref;
}
示例2: _prepareDocReference
/**
* Returns the reference representation to be stored in mongodb or null if not applicable.
*
* @param ClassMetadata $class
* @param Document $doc
* @return array|null
*/
private function _prepareDocReference(ClassMetadata $class, $doc)
{
if (!is_object($doc)) {
return $doc;
}
$id = $this->_uow->getDocumentIdentifier($doc);
if (null !== $id) {
$id = $class->getPHPIdentifierValue($id);
}
$ref = array($this->_cmd . 'ref' => $class->getCollection(), $this->_cmd . 'id' => $id, $this->_cmd . 'db' => $class->getDB());
return $ref;
}
示例3: _prepareDocReference
/**
* returns the reference representation to be stored in mongodb
* or null if not applicable
* @param ClassMetadata $class
* @param Document $doc
* @return array|null
*/
private function _prepareDocReference($class, $doc)
{
$docOid = spl_object_hash($doc);
if (isset($this->_documentIdentifiers[$docOid])) {
$id = $this->_documentIdentifiers[$docOid];
$ref = array('$ref' => $class->getCollection(), '$id' => $id, '$db' => $class->getDB());
return $ref;
}
return null;
}