本文整理匯總了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;
}