You are here

public static function LayoutBuilderIdsService::layoutBuilderIdsCheckIds in Layout builder ids 2.0.x

Function to check for duplicate ids.

Parameters

string $layout_builder_id: A string representing the if we are looking for.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

string $type: A string representing the type of check, either section or block.

Return value

bool A boolean value to whether or not there is a duplicate id.

Overrides LayoutBuilderIdsServiceInterface::layoutBuilderIdsCheckIds

1 call to LayoutBuilderIdsService::layoutBuilderIdsCheckIds()
LayoutBuilderIdsConfigureBlock::layoutBuilderIdsConfigureBlockFormValidation in src/EventSubscriber/LayoutBuilderIdsConfigureBlock.php

File

src/Service/LayoutBuilderIdsService.php, line 19

Class

LayoutBuilderIdsService
Class UWService.

Namespace

Drupal\layout_builder_ids\Service

Code

public static function layoutBuilderIdsCheckIds(string $layout_builder_id, FormStateInterface $form_state, string $type) : bool {

  // Return the found id, which will tell us if we have a
  // duplicate id.
  return LayoutBuilderIdsService::layoutBuilderIdsCheckSectionIds($layout_builder_id, $form_state, $type) || LayoutBuilderIdsService::layoutBuilderIdsCheckBlockIds($layout_builder_id, $form_state, $type);
}