public function SectionComponent::set in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::set()
- 9 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_builderCode
public function set($property, $value) {
if (property_exists($this, $property)) {
$this->{$property} = $value;
}
else {
$this->additional[$property] = $value;
}
return $this;
}