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


PHP ExtendHelper::isEntityAccessible方法代碼示例

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


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

 /**
  * {@inheritdoc}
  */
 protected function initializeHierarchy()
 {
     $entityConfigs = $this->extendConfigProvider->getConfigs();
     foreach ($entityConfigs as $entityConfig) {
         if (ExtendHelper::isEntityAccessible($entityConfig)) {
             $className = $entityConfig->getId()->getClassName();
             $parents = $this->loadParents($className);
             if (!empty($parents)) {
                 $this->hierarchy[$className] = $parents;
             }
         }
     }
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:16,代碼來源:EntityHierarchyProvider.php

示例3: initializeHierarchy

 /**
  * {@inheritdoc}
  */
 protected function initializeHierarchy()
 {
     $entityManagers = $this->entityManagerBag->getEntityManagers();
     foreach ($entityManagers as $em) {
         /** @var ClassMetadata[] $allMetadata */
         $allMetadata = $em->getMetadataFactory()->getAllMetadata();
         foreach ($allMetadata as $metadata) {
             if ($metadata->isMappedSuperclass) {
                 continue;
             }
             if ($this->extendConfigProvider->hasConfig($metadata->name) && !ExtendHelper::isEntityAccessible($this->extendConfigProvider->getConfig($metadata->name))) {
                 continue;
             }
             $parents = $this->loadParents($metadata->name);
             if (!empty($parents)) {
                 $this->hierarchy[$metadata->name] = $parents;
             }
         }
     }
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:23,代碼來源:AllEntityHierarchyProvider.php

示例4: 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

示例5: isApplicableField

 /**
  * {@inheritdoc}
  */
 public function isApplicableField($className, $fieldName)
 {
     if (null === $this->configManager->getConfigModelId($className, $fieldName)) {
         // this serializer works with non configurable entities as well
         return true;
     }
     if (true === $this->configManager->isHiddenModel($className, $fieldName)) {
         // exclude hidden fields
         return false;
     }
     $extendConfigProvider = $this->configManager->getProvider('extend');
     $extendConfig = $extendConfigProvider->getConfig($className, $fieldName);
     if (!$this->allowExtendedFields && $extendConfig->is('is_extend')) {
         // exclude extended fields if it is requested
         return false;
     }
     if (!ExtendHelper::isFieldAccessible($extendConfig)) {
         return false;
     }
     if ($extendConfig->has('target_entity') && !ExtendHelper::isEntityAccessible($extendConfigProvider->getConfig($extendConfig->get('target_entity')))) {
         return false;
     }
     return true;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:27,代碼來源:ExtendEntityFieldFilter.php

示例6: isApplicableField

 /**
  * @param ConfigInterface $extendConfig
  * @param ConfigProvider  $extendConfigProvider
  *
  * @return bool
  */
 protected function isApplicableField(ConfigInterface $extendConfig, ConfigProvider $extendConfigProvider)
 {
     return $extendConfig->is('owner', ExtendScope::OWNER_CUSTOM) && ExtendHelper::isFieldAccessible($extendConfig) && !in_array($extendConfig->getId()->getFieldType(), RelationType::$toAnyRelations, true) && (!$extendConfig->has('target_entity') || ExtendHelper::isEntityAccessible($extendConfigProvider->getConfig($extendConfig->get('target_entity'))));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:10,代碼來源:DynamicFieldsExtension.php

示例7: getEntityVariableGetters

 /**
  * @param string $entityClass
  *
  * @return array
  */
 protected function getEntityVariableGetters($entityClass)
 {
     $entityClass = ClassUtils::getRealClass($entityClass);
     $extendConfigProvider = $this->configManager->getProvider('extend');
     if (!$extendConfigProvider->hasConfig($entityClass) || !ExtendHelper::isEntityAccessible($extendConfigProvider->getConfig($entityClass))) {
         return [];
     }
     $result = [];
     $reflClass = new \ReflectionClass($entityClass);
     $fieldConfigs = $this->configManager->getProvider('email')->getConfigs($entityClass);
     foreach ($fieldConfigs as $fieldConfig) {
         if (!$fieldConfig->is('available_in_template')) {
             continue;
         }
         /** @var FieldConfigId $fieldId */
         $fieldId = $fieldConfig->getId();
         list($varName, $getter) = $this->getFieldAccessInfo($reflClass, $fieldId->getFieldName());
         if (!$varName) {
             continue;
         }
         $resultGetter = $getter;
         $formatters = $this->formatterManager->guessFormatters($fieldId);
         if ($formatters && count($formatters)) {
             $resultGetter = array_merge(['property_path' => $getter], $formatters);
         }
         $result[$varName] = $resultGetter;
     }
     return $result;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:34,代碼來源:EntityVariablesProvider.php

示例8: filterFields

 /**
  * @param ConfigInterface $config
  * @return bool
  */
 public function filterFields(ConfigInterface $config)
 {
     $extendConfig = $this->extendProvider->getConfigById($config->getId());
     /** @var FieldConfigId $fieldConfigId */
     $fieldConfigId = $extendConfig->getId();
     // skip system and not accessible fields
     if (!$config->is('owner', ExtendScope::OWNER_CUSTOM) || !ExtendHelper::isFieldAccessible($config)) {
         return false;
     }
     // skip invisible fields
     if (!$this->viewProvider->getConfigById($config->getId())->is('is_displayable')) {
         return false;
     }
     // skip relations if they are referenced to not accessible entity
     $underlyingFieldType = $this->fieldTypeHelper->getUnderlyingType($fieldConfigId->getFieldType());
     if (in_array($underlyingFieldType, RelationType::$anyToAnyRelations, true) && !ExtendHelper::isEntityAccessible($this->extendProvider->getConfig($extendConfig->get('target_entity')))) {
         return false;
     }
     return true;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:24,代碼來源:DynamicFieldsExtension.php

示例9: isEntityAccessible

 /**
  * Check if the given entity is ready to be used in a business logic.
  *
  * @param string $className
  *
  * @return bool
  */
 protected function isEntityAccessible($className)
 {
     return $this->extendConfigProvider->hasConfig($className) && ExtendHelper::isEntityAccessible($this->extendConfigProvider->getConfig($className));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:11,代碼來源:EntityFieldProvider.php

示例10: getUnmappedDynamicFieldsConfigs

 /**
  * @param ClassMetadata $classMetadata
  *
  * @return ConfigInterface[]
  */
 protected function getUnmappedDynamicFieldsConfigs(ClassMetadata $classMetadata)
 {
     return array_filter($this->entityExtendProvider->getConfigs($classMetadata->name), function (ConfigInterface $config) use($classMetadata) {
         return !$classMetadata->hasField($config->getId()->getFieldName()) && !$classMetadata->hasAssociation($config->getId()->getFieldName()) && !$config->is('is_deleted') && $config->is('owner', ExtendScope::OWNER_CUSTOM) && ExtendHelper::isFieldAccessible($config) && !in_array($config->getId()->getFieldType(), RelationType::$toAnyRelations, true) && (!$config->has('target_entity') || ExtendHelper::isEntityAccessible($this->entityExtendProvider->getConfig($config->get('target_entity'))));
     });
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:11,代碼來源:MetadataBuilder.php


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