function ConfigEntityBase::set
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::set()
- 10 core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::set()
- 9 core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::set()
- 8.9.x core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::set()
Attributes
Parameters
string $property_name: The name of the property that should be set.
mixed $value: The value the property should be set to.
Return value
$this
Overrides ConfigEntityInterface::set
15 calls to ConfigEntityBase::set()
- BlockContentType::setDescription in core/
modules/ block_content/ src/ Entity/ BlockContentType.php - ConfigEntityBase::preSave in core/
lib/ Drupal/ Core/ Config/ Entity/ ConfigEntityBase.php - ConfigEntityBase::__sleep in core/
lib/ Drupal/ Core/ Config/ Entity/ ConfigEntityBase.php - EntityDisplayBase::set in core/
lib/ Drupal/ Core/ Entity/ EntityDisplayBase.php - FieldConfigBase::postCreate in core/
lib/ Drupal/ Core/ Field/ FieldConfigBase.php
1 method overrides ConfigEntityBase::set()
- EntityDisplayBase::set in core/
lib/ Drupal/ Core/ Entity/ EntityDisplayBase.php
File
-
core/
lib/ Drupal/ Core/ Config/ Entity/ ConfigEntityBase.php, line 170
Class
- ConfigEntityBase
- Defines a base configuration entity class.
Namespace
Drupal\Core\Config\EntityCode
public function set($property_name, $value) {
if ($this instanceof EntityWithPluginCollectionInterface && !$this->isSyncing()) {
$plugin_collections = $this->getPluginCollections();
if (isset($plugin_collections[$property_name])) {
// If external code updates the settings, pass it along to the plugin.
$plugin_collections[$property_name]->setConfiguration($value);
}
}
$this->{$property_name} = $value;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.