public function EntityDescriptionFormTrait::save in Lightning Core 8
Same name and namespace in other branches
- 8.5 src/EntityDescriptionFormTrait.php \Drupal\lightning_core\EntityDescriptionFormTrait::save()
- 8.2 src/EntityDescriptionFormTrait.php \Drupal\lightning_core\EntityDescriptionFormTrait::save()
- 8.3 src/EntityDescriptionFormTrait.php \Drupal\lightning_core\EntityDescriptionFormTrait::save()
- 8.4 src/EntityDescriptionFormTrait.php \Drupal\lightning_core\EntityDescriptionFormTrait::save()
File
- src/
EntityDescriptionFormTrait.php, line 37
Class
- EntityDescriptionFormTrait
- Adds description support to entity forms.
Namespace
Drupal\lightning_coreCode
public function save(array $form, FormStateInterface $form_state) {
$this
->getEntity()
->setDescription($form_state
->getValue('description'));
parent::save($form, $form_state);
// The help text block is very likely to be render cached, so invalidate the
// relevant cache tag.
//
// @see lightning_core_block_view_alter()
// @see lightning_core_help().
$this
->cacheTagInvalidator()
->invalidateTags([
'block_view:help_block',
]);
}