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


PHP ConfigManager::getEntityConfig方法代碼示例

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


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

示例1: isIgnoredRelation

 /**
  * {@inheritdoc}
  */
 public function isIgnoredRelation(ClassMetadata $metadata, $associationName)
 {
     if (!$this->configManager->hasConfig($metadata->name, $associationName)) {
         return false;
     }
     $extendFieldConfig = $this->configManager->getFieldConfig('extend', $metadata->name, $associationName);
     return !ExtendHelper::isFieldAccessible($extendFieldConfig) || $this->configManager->isHiddenModel($metadata->name, $associationName) || $extendFieldConfig->has('target_entity') && !ExtendHelper::isEntityAccessible($this->configManager->getEntityConfig('extend', $extendFieldConfig->get('target_entity')));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:11,代碼來源:ExtendExclusionProvider.php

示例2: isAttachmentAssociationEnabled

 /**
  * Checks whether attachments are enabled for a given entity type.
  *
  * @param string $entityClass The target entity class
  * @param bool $accessible    Whether an association with the target entity should be checked
  *                            to be ready to use in a business logic.
  *                            It means that the association should exist and should not be marked as deleted.
  *
  * @return bool
  */
 public function isAttachmentAssociationEnabled($entityClass, $accessible = true)
 {
     if (!$this->configManager->hasConfig($entityClass)) {
         return false;
     }
     if (!$this->configManager->getEntityConfig('attachment', $entityClass)->is('enabled')) {
         return false;
     }
     return !$accessible || $this->isAttachmentAssociationAccessible($entityClass);
 }
開發者ID:snorchel,項目名稱:platform,代碼行數:20,代碼來源:AttachmentAssociationHelper.php

示例3: hasActivityAssociations

 /**
  * Checks whether a given entity type has at least one enabled activity association.
  *
  * @param string $entityClass The target entity class
  *
  * @return bool
  */
 public function hasActivityAssociations($entityClass)
 {
     if (!$this->configManager->hasConfig($entityClass)) {
         return false;
     }
     $activities = $this->configManager->getEntityConfig('activity', $entityClass)->get('activities', false, []);
     foreach ($activities as $activityClass) {
         if ($this->isActivityAssociationAccessible($entityClass, $activityClass)) {
             return true;
         }
     }
     return false;
 }
開發者ID:woei66,項目名稱:platform,代碼行數:20,代碼來源:ActivityAssociationHelper.php

示例4: isIgnoredRelation

 /**
  * {@inheritdoc}
  */
 public function isIgnoredRelation(ClassMetadata $metadata, $associationName)
 {
     if (!$this->configManager->hasConfig($metadata->name, $associationName)) {
         return false;
     }
     $groups = $this->configManager->getEntityConfig('grouping', $metadata->name)->get('groups');
     if (empty($groups) || !in_array(ActivityScope::GROUP_ACTIVITY, $groups, true)) {
         return false;
     }
     $mapping = $metadata->getAssociationMapping($associationName);
     if (!$mapping['isOwningSide'] || !($mapping['type'] & ClassMetadata::MANY_TO_MANY)) {
         return false;
     }
     $activityAssociationName = ExtendHelper::buildAssociationName($mapping['targetEntity'], ActivityScope::ASSOCIATION_KIND);
     return $associationName === $activityAssociationName;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:19,代碼來源:ActivityExclusionProvider.php

示例5: getConfigById

 /**
  * Gets configuration data for the given entity or field.
  *
  * @param ConfigIdInterface $configId
  *
  * @return ConfigInterface
  */
 public function getConfigById(ConfigIdInterface $configId)
 {
     $className = $configId->getClassName();
     if ($configId instanceof FieldConfigId) {
         return $this->configManager->getFieldConfig($this->scope, $className, $configId->getFieldName());
     } elseif ($className) {
         return $this->configManager->getEntityConfig($this->scope, $className);
     } else {
         return $this->configManager->createEntityConfig($this->scope);
     }
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:18,代碼來源:ConfigProvider.php

示例6: isIgnoredRelation

 /**
  * {@inheritdoc}
  */
 public function isIgnoredRelation(ClassMetadata $metadata, $associationName)
 {
     if (!$this->configManager->hasConfig($metadata->name, $associationName)) {
         return false;
     }
     $extendFieldConfig = $this->configManager->getFieldConfig('extend', $metadata->name, $associationName);
     if (!ExtendHelper::isFieldAccessible($extendFieldConfig)) {
         return true;
     }
     if ($this->excludeHiddenFields && $this->configManager->isHiddenModel($metadata->name, $associationName)) {
         return true;
     }
     if ($extendFieldConfig->has('target_entity')) {
         $targetEntity = $extendFieldConfig->get('target_entity');
         if (!ExtendHelper::isEntityAccessible($this->configManager->getEntityConfig('extend', $targetEntity))) {
             return true;
         }
         if ($this->excludeHiddenEntities && $this->configManager->isHiddenModel($targetEntity)) {
             return true;
         }
     }
     return false;
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:26,代碼來源:ExtendExclusionProvider.php

示例7: isAllowedOnPage

 /**
  * @param string $entityClass
  * @param int    $pageType
  *
  * @return bool
  */
 protected function isAllowedOnPage($entityClass, $pageType)
 {
     return ActivityScope::isAllowedOnPage($pageType, $this->configManager->getEntityConfig('activity', $entityClass)->get(ActivityScope::SHOW_ON_PAGE));
 }
開發者ID:woei66,項目名稱:platform,代碼行數:10,代碼來源:PlaceholderFilter.php

示例8: getEntityConfig

 /**
  * @param string $className
  *
  * @return ConfigInterface
  */
 protected function getEntityConfig($className)
 {
     return $this->configManager->getEntityConfig('extend', $className);
 }
開發者ID:paulstoica,項目名稱:platform,代碼行數:9,代碼來源:RelationEntityConfigDumperExtension.php

示例9: getConfigForClass

 /**
  * @param $className
  *
  * @return array
  */
 protected function getConfigForClass($className)
 {
     return $this->configManager->getEntityConfig('activity', $className)->getValues();
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:9,代碼來源:ActivityInheritanceTargetsHelper.php


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