當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DoctrineHelper::isNewEntity方法代碼示例

本文整理匯總了PHP中Oro\Bundle\EntityBundle\ORM\DoctrineHelper::isNewEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP DoctrineHelper::isNewEntity方法的具體用法?PHP DoctrineHelper::isNewEntity怎麽用?PHP DoctrineHelper::isNewEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Oro\Bundle\EntityBundle\ORM\DoctrineHelper的用法示例。


在下文中一共展示了DoctrineHelper::isNewEntity方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isNoteAssociationEnabled

 /**
  * Checks if the entity can has notes
  *
  * @param object $entity
  * @return bool
  */
 public function isNoteAssociationEnabled($entity)
 {
     if (!is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     return $this->noteAssociationHelper->isNoteAssociationEnabled(ClassUtils::getClass($entity));
 }
開發者ID:snorchel,項目名稱:platform,代碼行數:13,代碼來源:PlaceholderFilter.php

示例2: isAttachmentAssociationEnabled

 /**
  * Delegated method
  *
  * @param object $entity
  * @return bool
  */
 public function isAttachmentAssociationEnabled($entity)
 {
     if (!is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     return $this->config->isAttachmentAssociationEnabled($entity);
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:13,代碼來源:PlaceholderFilter.php

示例3: isNoteAssociationEnabled

 /**
  * Checks if the entity can has notes
  *
  * @param object $entity
  * @return bool
  */
 public function isNoteAssociationEnabled($entity)
 {
     if (!is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     $className = ClassUtils::getClass($entity);
     return $this->noteConfigProvider->hasConfig($className) && $this->noteConfigProvider->getConfig($className)->is('enabled') && $this->entityConfigProvider->hasConfig(Note::ENTITY_NAME, ExtendHelper::buildAssociationName($className));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:14,代碼來源:PlaceholderFilter.php

示例4: isApplicable

 /**
  * Checks if the entity can have activities
  *
  * @param object|null $entity
  * @param int|null    $pageType
  * @return bool
  */
 public function isApplicable($entity = null, $pageType = null)
 {
     if ($pageType === null || !is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     $pageType = (int) $pageType;
     $id = $this->doctrineHelper->getSingleEntityIdentifier($entity);
     $entityClass = $this->doctrineHelper->getEntityClass($entity);
     $activityListRepo = $this->doctrine->getRepository('OroActivityListBundle:ActivityList');
     return $this->isAllowedOnPage($entity, $pageType) && (in_array($entityClass, $this->activityListProvider->getTargetEntityClasses()) || (bool) $activityListRepo->getRecordsCountForTargetClassAndId($entityClass, $id));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:18,代碼來源:PlaceholderFilter.php

示例5: isApplicable

 /**
  * Checks if the entity can have activities
  *
  * @param object|null $entity
  * @param int|null    $pageType
  *
  * @return bool
  */
 public function isApplicable($entity = null, $pageType = null)
 {
     if (null === $pageType || !is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     $entityClass = $this->doctrineHelper->getEntityClass($entity);
     if (isset($this->applicableCache[$entityClass])) {
         return $this->applicableCache[$entityClass];
     }
     $result = false;
     if ($this->configManager->hasConfig($entityClass) && $this->isAllowedOnPage($entityClass, $pageType) && $this->hasApplicableActivityAssociations($entityClass)) {
         $result = in_array($entityClass, $this->activityListProvider->getTargetEntityClasses(), true) || !$this->isActivityListEmpty($entityClass, $this->doctrineHelper->getSingleEntityIdentifier($entity));
     }
     $this->applicableCache[$entityClass] = $result;
     return $result;
 }
開發者ID:woei66,項目名稱:platform,代碼行數:24,代碼來源:PlaceholderFilter.php

示例6: isApplicable

 /**
  *
  * @param object $entity
  * @return bool
  */
 public function isApplicable($entity)
 {
     if (!is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     //$allowedValues = $this->configProvider->getAllowed();
     $allowedSection = $this->getAllowedSection();
     $className = ClassUtils::getClass($entity);
     $allowedSection = $allowedSection['allowed'];
     foreach ($allowedSection as $allowedValue) {
         if ($allowedValue == $className) {
             return true;
         }
     }
     //echo $className;die();
     return false;
 }
開發者ID:jneto81,項目名稱:orocrm-pdfmanager,代碼行數:22,代碼來源:PlaceholderFilter.php

示例7: testIsNewEntity

 /**
  * @param object $entity
  * @param string $class
  * @param array $identifiers
  * @param bool $expected
  * @dataProvider testIsNewEntityDataProvider
  */
 public function testIsNewEntity($entity, $class, array $identifiers, $expected)
 {
     $this->classMetadata->expects($this->once())->method('getIdentifierValues')->with($entity)->will($this->returnCallback(function ($entity) use($identifiers) {
         $res = [];
         foreach ($identifiers as $identifier) {
             if (isset($entity->{$identifier})) {
                 $res[$identifier] = $entity->{$identifier};
             }
         }
         return $res;
     }));
     $this->em->expects($this->once())->method('getClassMetadata')->with($class)->will($this->returnValue($this->classMetadata));
     $this->registry->expects($this->once())->method('getManagerForClass')->with($class)->will($this->returnValue($this->em));
     $this->assertEquals($expected, $this->doctrineHelper->isNewEntity($entity));
 }
開發者ID:antrampa,項目名稱:platform,代碼行數:22,代碼來源:DoctrineHelperTest.php


注:本文中的Oro\Bundle\EntityBundle\ORM\DoctrineHelper::isNewEntity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。