function FilterFormat::getFilterTypes

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

Overrides FilterFormatInterface::getFilterTypes

File

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

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Entity

Code

public function getFilterTypes() {
    $filter_types = [];
    $filters = $this->filters();
    foreach ($filters as $filter) {
        if ($filter->status) {
            $filter_types[] = $filter->getType();
        }
    }
    return array_unique($filter_types);
}

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