本文整理汇总了PHP中Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper::isEnumValueEntityAccessible方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtendHelper::isEnumValueEntityAccessible方法的具体用法?PHP ExtendHelper::isEnumValueEntityAccessible怎么用?PHP ExtendHelper::isEnumValueEntityAccessible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper
的用法示例。
在下文中一共展示了ExtendHelper::isEnumValueEntityAccessible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSupportedEntityClasses
/**
* {@inheritdoc}
*/
public function getSupportedEntityClasses()
{
$result = [];
$extendConfigProvider = $this->configManager->getProvider('extend');
foreach ($extendConfigProvider->getConfigs(null, true) as $extendConfig) {
if (ExtendHelper::isEnumValueEntityAccessible($extendConfig)) {
$result[] = $extendConfig->getId()->getClassName();
}
}
return $result;
}
示例2: getPotentialEnumHolderClassNames
/**
* @return string[]
*/
protected function getPotentialEnumHolderClassNames()
{
if (null === $this->potentialEnumHolderClassNames) {
$this->potentialEnumHolderClassNames = array_map(function (ConfigInterface $config) {
return $config->getId()->getClassName();
}, $this->configManager->getProvider('extend')->filter(function (ConfigInterface $config) {
return ExtendHelper::isEnumValueEntityAccessible($config);
}));
// skip dictionaries
$groupingConfigProvider = $this->configManager->getProvider('grouping');
$this->potentialEnumHolderClassNames = array_filter($this->potentialEnumHolderClassNames, function ($className) use($groupingConfigProvider) {
if (!$groupingConfigProvider->hasConfig($className)) {
return true;
}
$config = $groupingConfigProvider->getConfig($className);
$groups = $config->get('groups');
if (empty($groups)) {
return true;
}
return !in_array(GroupingScope::GROUP_DICTIONARY, $groups, true);
});
}
return $this->potentialEnumHolderClassNames;
}
示例3: getPublicEnumTypes
/**
* Returns the list of data type keys for all public enums
*
* @return string[] key = enum code, value = data type key
*/
public function getPublicEnumTypes()
{
$result = [];
$enumConfigProvider = $this->configManager->getProvider('enum');
$extendConfigProvider = $this->configManager->getProvider('extend');
$entityConfigs = $extendConfigProvider->getConfigs(null, true);
foreach ($entityConfigs as $entityConfig) {
if (!ExtendHelper::isEnumValueEntityAccessible($entityConfig)) {
continue;
}
$className = $entityConfig->getId()->getClassName();
$enumConfig = $enumConfigProvider->getConfig($className);
if (!$enumConfig->is('public')) {
continue;
}
$enumCode = $enumConfig->get('code');
$result[$enumCode] = ($enumConfig->is('multiple') ? 'multiEnum' : 'enum') . '||' . $enumCode;
}
return $result;
}