You are here

public static function QuickEditIntegration::deconstructViewModeId in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/QuickEditIntegration.php \Drupal\layout_builder\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_builder

Code

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,
  ];
}