Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SectionComponent.php

function SectionComponent::fromArray

Creates an object from an array representation of the section component.

Only use this method if you are implementing custom storage for sections.

Parameters

array $component: An array of section component data in the format returned by ::toArray().

Return value

static The section component object.

1 call to SectionComponent::fromArray()
AddNavigationBlock::apply in core/modules/navigation/src/Plugin/ConfigAction/AddNavigationBlock.php
Applies the config action.

File

core/modules/layout_builder/src/SectionComponent.php, line 311

Class

SectionComponent
Provides a value object for a section component.

Namespace

Drupal\layout_builder

Code

public static function fromArray(array $component) {
    return (new static($component['uuid'], $component['region'], $component['configuration'], $component['additional']))->setWeight($component['weight']);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal