class SectionData
Same name and namespace in other branches
- 8.9.x core/modules/layout_builder/src/Plugin/DataType/SectionData.php \Drupal\layout_builder\Plugin\DataType\SectionData
- 10 core/modules/layout_builder/src/Plugin/DataType/SectionData.php \Drupal\layout_builder\Plugin\DataType\SectionData
- 11.x core/modules/layout_builder/src/Plugin/DataType/SectionData.php \Drupal\layout_builder\Plugin\DataType\SectionData
Provides a data type wrapping \Drupal\layout_builder\Section.
@DataType( id = "layout_section", label = @Translation("Layout Section"), description = @Translation("A layout section"), )
@internal Plugin classes are internal.
Hierarchy
- class \Drupal\Core\TypedData\TypedData implements \Drupal\Core\TypedData\TypedDataInterface, \Drupal\Component\Plugin\PluginInspectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\TypedData\TypedDataTrait
- class \Drupal\layout_builder\Plugin\DataType\SectionData extends \Drupal\Core\TypedData\TypedData
Expanded class hierarchy of SectionData
File
-
core/
modules/ layout_builder/ src/ Plugin/ DataType/ SectionData.php, line 20
Namespace
Drupal\layout_builder\Plugin\DataTypeView source
class SectionData extends TypedData {
/**
* The section object.
*
* @var \Drupal\layout_builder\Section
*/
protected $value;
/**
* {@inheritdoc}
*/
public function setValue($value, $notify = TRUE) {
if ($value && !$value instanceof Section) {
throw new \InvalidArgumentException(sprintf('Value assigned to "%s" is not a valid section', $this->getName()));
}
parent::setValue($value, $notify);
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.