本文整理汇总了PHP中Drupal\Core\Entity\Entity\EntityFormDisplay::loadMultiple方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityFormDisplay::loadMultiple方法的具体用法?PHP EntityFormDisplay::loadMultiple怎么用?PHP EntityFormDisplay::loadMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\Entity\EntityFormDisplay
的用法示例。
在下文中一共展示了EntityFormDisplay::loadMultiple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: image_post_update_image_style_dependencies
/**
* Saves the image style dependencies into form and view display entities.
*/
function image_post_update_image_style_dependencies()
{
// Merge view and form displays. Use array_values() to avoid key collisions.
$displays = array_merge(array_values(EntityViewDisplay::loadMultiple()), array_values(EntityFormDisplay::loadMultiple()));
/** @var \Drupal\Core\Entity\Display\EntityDisplayInterface[] $displays */
foreach ($displays as $display) {
// Re-save each config entity to add missed dependencies.
$display->save();
}
}
示例2: field_post_update_email_widget_size_setting
/**
* Adds the 'size' setting for email widgets.
*/
function field_post_update_email_widget_size_setting()
{
foreach (EntityFormDisplay::loadMultiple() as $entity_form_display) {
$changed = FALSE;
foreach ($entity_form_display->getComponents() as $name => $options) {
if (isset($options['type']) && $options['type'] === 'email_default') {
$options['settings']['size'] = '60';
$entity_form_display->setComponent($name, $options);
$changed = TRUE;
}
}
if ($changed) {
$entity_form_display->save();
}
}
return t('The new size setting for email widgets has been added.');
}