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


PHP DoctrineHelper::getEntityIdentifier方法代码示例

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


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

示例1: testGetEntityIdentifierNotManageableEntity

 public function testGetEntityIdentifierNotManageableEntity()
 {
     $entity = $this->getMock('FooEntity');
     $this->setExpectedException('Oro\\Bundle\\EntityBundle\\Exception\\NotManageableEntityException', sprintf('Entity class "%s" is not manageable', get_class($entity)));
     $this->registry->expects($this->once())->method('getManagerForClass')->with(get_class($entity))->will($this->returnValue(null));
     $this->doctrineHelper->getEntityIdentifier($entity);
 }
开发者ID:xamin123,项目名称:platform,代码行数:7,代码来源:DoctrineHelperTest.php

示例2: normalize

 /**
  * {@inheritdoc}
  */
 public function normalize(Workflow $workflow, Attribute $attribute, $attributeValue)
 {
     if (null === $attributeValue) {
         return null;
     }
     $this->validateAttributeValue($workflow, $attribute, $attributeValue);
     $identifier = $this->doctrineHelper->getEntityIdentifier($attributeValue);
     return $identifier ?: null;
 }
开发者ID:xamin123,项目名称:platform,代码行数:12,代码来源:EntityAttributeNormalizer.php

示例3: normalize

 /**
  * {@inheritdoc}
  */
 public function normalize(Workflow $workflow, Attribute $attribute, $attributeValue)
 {
     if (null === $attributeValue) {
         return null;
     }
     $this->validateAttributeValue($workflow, $attribute, $attributeValue);
     $result = [];
     foreach ($attributeValue as $value) {
         $result[] = $this->doctrineHelper->getEntityIdentifier($value);
     }
     return $result;
 }
开发者ID:Maksold,项目名称:platform,代码行数:15,代码来源:MultipleEntityAttributeNormalizer.php

示例4: doCompare

 /**
  * Compare two values for equality
  *
  * @param mixed $left
  * @param mixed $right
  * @return boolean
  */
 protected function doCompare($left, $right)
 {
     if (is_object($left) && is_object($right)) {
         $leftClass = $this->doctrineHelper->getEntityClass($left);
         $rightClass = $this->doctrineHelper->getEntityClass($right);
         if ($leftClass == $rightClass && $this->doctrineHelper->isManageableEntity($left) && $this->doctrineHelper->isManageableEntity($right)) {
             $leftIdentifier = $this->doctrineHelper->getEntityIdentifier($left);
             $rightIdentifier = $this->doctrineHelper->getEntityIdentifier($right);
             return $leftIdentifier == $rightIdentifier;
         }
     }
     return $left == $right;
 }
开发者ID:xamin123,项目名称:platform,代码行数:20,代码来源:EqualTo.php

示例5: convertToPlainArray

 /**
  * @param array|\Traversable $values
  * @return array
  */
 protected function convertToPlainArray($values)
 {
     $result = array();
     foreach ($values as $key => $value) {
         if (is_object($value) && $this->doctrineHelper->isManageableEntity($value)) {
             $result[$key] = $this->doctrineHelper->getEntityIdentifier($value);
         } elseif (is_array($value) || $value instanceof \Traversable) {
             $result[$key] = $this->convertToPlainArray($value);
         } else {
             $result[$key] = $value;
         }
     }
     return $result;
 }
开发者ID:Maksold,项目名称:platform,代码行数:18,代码来源:WorkflowResultHandler.php

示例6: reloadEntity

 /**
  * @param object $entity
  * @return Integration
  */
 protected function reloadEntity($entity)
 {
     return $this->doctrineHelper->getEntity($this->doctrineHelper->getEntityClass($entity), $this->doctrineHelper->getEntityIdentifier($entity));
 }
开发者ID:antrampa,项目名称:crm,代码行数:8,代码来源:InitialScheduleProcessor.php


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