本文整理匯總了PHP中Oro\Bundle\EntityConfigBundle\Config\ConfigManager::getConfigModelId方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigManager::getConfigModelId方法的具體用法?PHP ConfigManager::getConfigModelId怎麽用?PHP ConfigManager::getConfigModelId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Oro\Bundle\EntityConfigBundle\Config\ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::getConfigModelId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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 ($extendConfig->is('is_deleted') || $extendConfig->is('state', ExtendScope::STATE_NEW)) {
// exclude deleted and not created yet fields
return false;
}
if ($extendConfig->has('target_entity') && $extendConfigProvider->getConfig($extendConfig->get('target_entity'))->is('is_deleted')) {
// exclude associations with deleted custom entities
return false;
}
return true;
}
示例2: getEntitiesMetadata
/**
* {@inheritdoc}
*/
public function getEntitiesMetadata()
{
$result = [];
foreach ($this->getChannelEntities() as $entityName) {
$entityConfig = $this->entityProvider->getEntity($entityName, true);
$extendConfig = $this->configManager->getProvider('extend')->getConfig($entityName);
$entityConfigModelId = $this->configManager->getConfigModelId($entityName);
if (null !== $entityConfigModelId) {
$entityConfig = array_merge($entityConfig, $this->getEntityLinks($entityConfigModelId));
}
$result[$entityName] = array_merge($entityConfig, ['type' => $extendConfig->get('owner')]);
}
return $result;
}
示例3: 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;
}