function SectionComponent::set
Same name in other branches
- 9 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::set()
- 8.9.x core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::set()
- 11.x 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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.