function SectionComponent::get

Same name in other branches
  1. 9 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::get()
  2. 10 core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::get()
  3. 11.x core/modules/layout_builder/src/SectionComponent.php \Drupal\layout_builder\SectionComponent::get()

Gets any arbitrary property for the component.

Parameters

string $property: The property to retrieve.

Return value

mixed The value for that property, or NULL if the property does not exist.

File

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

Class

SectionComponent
Provides a value object for a section component.

Namespace

Drupal\layout_builder

Code

public function get($property) {
    if (property_exists($this, $property)) {
        $value = isset($this->{$property}) ? $this->{$property} : NULL;
    }
    else {
        $value = isset($this->additional[$property]) ? $this->additional[$property] : NULL;
    }
    return $value;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.