You are here

public function SectionComponent::set in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::set()
  2. 10 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\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;
}