function QuickEditIntegration::deconstructViewModeId
Deconstructs the Quick Edit view mode ID into its constituent parts.
Parameters
string $quick_edit_view_mode_id: The Quick Edit view mode ID.
Return value
array An array containing the entity view mode ID, the delta, the component UUID, and the entity ID.
See also
\Drupal\layout_builder\QuickEditIntegration::getViewModeId()
2 calls to QuickEditIntegration::deconstructViewModeId()
- LayoutBuilderEntityViewDisplay::getQuickEditSectionComponent in core/
modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php - Returns the Quick Edit formatter settings.
- QuickEditIntegration::quickEditRenderField in core/
modules/ layout_builder/ src/ QuickEditIntegration.php - Re-renders a field rendered by Layout Builder, edited with Quick Edit.
File
-
core/
modules/ layout_builder/ src/ QuickEditIntegration.php, line 221
Class
- QuickEditIntegration
- Helper methods for Quick Edit module integration.
Namespace
Drupal\layout_builderCode
public static function deconstructViewModeId($quick_edit_view_mode_id) {
list(, $entity_view_mode_id, $delta, $component_uuid, $entity_id) = explode('-', $quick_edit_view_mode_id, 7);
return [
$entity_view_mode_id,
// @todo Explicitly cast delta to an integer, remove this in
// https://www.drupal.org/project/drupal/issues/2984509.
(int) $delta,
// Replace the underscores with dash to get back the component UUID.
str_replace('_', '-', $component_uuid),
$entity_id,
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.