当前位置: 首页>>代码示例>>PHP>>正文


PHP UnitOfWork::isInIdentityMap方法代码示例

本文整理汇总了PHP中Doctrine\ODM\MongoDB\UnitOfWork::isInIdentityMap方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitOfWork::isInIdentityMap方法的具体用法?PHP UnitOfWork::isInIdentityMap怎么用?PHP UnitOfWork::isInIdentityMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ODM\MongoDB\UnitOfWork的用法示例。


在下文中一共展示了UnitOfWork::isInIdentityMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: contains

 /**
  * Determines whether a document instance is managed in this DocumentManager.
  *
  * @param object $document
  * @return boolean TRUE if this DocumentManager currently manages the given document, FALSE otherwise.
  */
 public function contains($document)
 {
     if (!is_object($document)) {
         throw new \InvalidArgumentException(gettype($document));
     }
     return $this->unitOfWork->isScheduledForInsert($document) || $this->unitOfWork->isInIdentityMap($document) && !$this->unitOfWork->isScheduledForDelete($document);
 }
开发者ID:noikiy,项目名称:inovi,代码行数:13,代码来源:DocumentManager.php

示例2: getIdentifierValue

 /**
  * Returns the value of the identifier field of a document
  *
  * Doctrine must know about this document, that is, the document must already
  * be persisted or added to the identity map before. Otherwise an
  * exception is thrown.
  *
  * @param  object $document  The document for which to get the identifier
  * @throws FormException   If the document does not exist in Doctrine's
  *                         identity map
  */
 public function getIdentifierValue($document)
 {
     if (!$this->unitOfWork->isInIdentityMap($document)) {
         throw new FormException('documents passed to the choice field must be managed');
     }
     return $this->unitOfWork->getDocumentIdentifier($document);
 }
开发者ID:3116246,项目名称:haolinju,代码行数:18,代码来源:DocumentChoiceList.php

示例3: contains

 /**
  * Determines whether a document instance is managed in this DocumentManager.
  *
  * @param object $document
  * @return boolean TRUE if this DocumentManager currently manages the given document, FALSE otherwise.
  */
 public function contains($document)
 {
     return $this->unitOfWork->isScheduledForInsert($document) || $this->unitOfWork->isInIdentityMap($document) && !$this->unitOfWork->isScheduledForDelete($document);
 }
开发者ID:nextmotion,项目名称:mongodb-odm,代码行数:10,代码来源:DocumentManager.php


注:本文中的Doctrine\ODM\MongoDB\UnitOfWork::isInIdentityMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。