function FilterFormat::preSave

Same name and namespace in other branches
  1. 9 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::preSave()
  2. 10 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::preSave()
  3. 11.x core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::preSave()

Overrides ConfigEntityBase::preSave

File

core/modules/filter/src/Entity/FilterFormat.php, line 203

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Entity

Code

public function preSave(EntityStorageInterface $storage) {
    // Ensure the filters have been sorted before saving.
    $this->filters()
        ->sort();
    parent::preSave($storage);
    $this->name = trim($this->label());
}

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