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

Breadcrumb

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

function SectionComponent::set

Sets a value to an arbitrary property for the component.

Parameters

string $property: The property to use for the value.

mixed $value: The value to set.

Return value

$this

File

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

Class

SectionComponent
Provides a value object for a section component.

Namespace

Drupal\layout_builder

Code

public function set($property, $value) {
    if (property_exists($this, $property)) {
        $this->{$property} = $value;
    }
    else {
        $this->additional[$property] = $value;
    }
    return $this;
}
RSS feed
Powered by Drupal