You are here

public function LayoutParagraphsTempstoreParamConverter::convert in Layout Paragraphs 2.0.x

Converts path variables to their corresponding objects.

Parameters

mixed $value: The raw value.

mixed $definition: The parameter definition provided in the route options.

string $name: The name of the parameter.

array $defaults: The route defaults array.

Return value

mixed|null The converted parameter value.

Overrides ParamConverterInterface::convert

File

src/Routing/LayoutParagraphsTempstoreParamConverter.php, line 47

Class

LayoutParagraphsTempstoreParamConverter
Layout paragraphs tempstore param converter service.

Namespace

Drupal\layout_paragraphs\Routing

Code

public function convert($value, $definition, $name, array $defaults) {
  if (empty($defaults['layout_paragraphs_layout'])) {
    return NULL;
  }
  $key = $defaults['layout_paragraphs_layout'];
  return $this->layoutParagraphsLayoutTempstore
    ->getWithStorageKey($key);
}