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


PHP ConfigManager::hasConfigEntityModel方法代码示例

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


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

示例1: createEnumValueConfigEntityModel

 /**
  * @param string    $enumValueClassName The full class name of an entity is used to store enum values
  * @param string    $enumCode           The unique identifier of an enum
  * @param bool      $isMultiple         Indicates whether several options can be selected for this enum
  *                                      or it supports only one selected option
  * @param bool|null $isPublic           Indicates whether this enum can be used by any entity or
  *                                      it is designed to use in one entity only
  *                                      NULL means unspecified. In this case this attribute will not be
  *                                      changed for existing enum entity and will be set to FALSE
  *                                      for new enum entity
  */
 protected function createEnumValueConfigEntityModel($enumValueClassName, $enumCode, $isMultiple, $isPublic)
 {
     if ($this->configManager->hasConfigEntityModel($enumValueClassName)) {
         if (null !== $isPublic) {
             $this->relationBuilder->updateEntityConfigs($enumValueClassName, ['enum' => ['public' => $isPublic]]);
         }
         return;
     }
     if (null === $isPublic) {
         $isPublic = false;
     }
     // create entity
     $this->configManager->createConfigEntityModel($enumValueClassName, ConfigModelManager::MODE_HIDDEN);
     $this->relationBuilder->updateEntityConfigs($enumValueClassName, ['entity' => ['label' => ExtendHelper::getEnumTranslationKey('label', $enumCode), 'plural_label' => ExtendHelper::getEnumTranslationKey('plural_label', $enumCode), 'description' => ExtendHelper::getEnumTranslationKey('description', $enumCode)], 'extend' => ['owner' => ExtendScope::OWNER_SYSTEM, 'is_extend' => true, 'table' => $this->nameGenerator->generateEnumTableName($enumCode, true), 'inherit' => ExtendHelper::BASE_ENUM_VALUE_CLASS], 'enum' => ['code' => $enumCode, 'public' => $isPublic, 'multiple' => $isMultiple]]);
     // create fields
     $this->configManager->createConfigFieldModel($enumValueClassName, 'id', 'string');
     $this->relationBuilder->updateFieldConfigs($enumValueClassName, 'id', ['entity' => ['label' => ExtendHelper::getEnumTranslationKey('label', $enumCode, 'id'), 'description' => ExtendHelper::getEnumTranslationKey('description', $enumCode, 'id')], 'importexport' => ['identity' => true]]);
     $this->configManager->createConfigFieldModel($enumValueClassName, 'name', 'string');
     $this->relationBuilder->updateFieldConfigs($enumValueClassName, 'name', ['entity' => ['label' => ExtendHelper::getEnumTranslationKey('label', $enumCode, 'name'), 'description' => ExtendHelper::getEnumTranslationKey('description', $enumCode, 'name')], 'datagrid' => ['is_visible' => false]]);
     $this->configManager->createConfigFieldModel($enumValueClassName, 'priority', 'integer');
     $this->relationBuilder->updateFieldConfigs($enumValueClassName, 'priority', ['entity' => ['label' => ExtendHelper::getEnumTranslationKey('label', $enumCode, 'priority'), 'description' => ExtendHelper::getEnumTranslationKey('description', $enumCode, 'priority')], 'datagrid' => ['is_visible' => false]]);
     $this->configManager->createConfigFieldModel($enumValueClassName, 'default', 'boolean');
     $this->relationBuilder->updateFieldConfigs($enumValueClassName, 'default', ['entity' => ['label' => ExtendHelper::getEnumTranslationKey('label', $enumCode, 'default'), 'description' => ExtendHelper::getEnumTranslationKey('description', $enumCode, 'default')], 'datagrid' => ['is_visible' => false]]);
 }
开发者ID:hugeval,项目名称:platform,代码行数:35,代码来源:EnumEntityConfigDumperExtension.php

示例2: testHasConfigEntityModel

 public function testHasConfigEntityModel()
 {
     $this->modelManager->expects($this->once())->method('findEntityModel')->with(self::ENTITY_CLASS)->willReturn($this->createEntityConfigModel(self::ENTITY_CLASS));
     $result = $this->configManager->hasConfigEntityModel(self::ENTITY_CLASS);
     $this->assertTrue($result);
 }
开发者ID:Maksold,项目名称:platform,代码行数:6,代码来源:ConfigManagerTest.php

示例3: hasConfigForInheritanceTarget

 /**
  * @param $value
  *
  * @return bool
  */
 protected function hasConfigForInheritanceTarget($value)
 {
     $result = is_array($value) && array_key_exists('target', $value) && $this->configManager->hasConfigEntityModel($value['target']);
     return $result;
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:ActivityInheritanceTargetsHelper.php


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