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