You are here

public function FilterFormat::getFilterTypes in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::getFilterTypes()

Retrieves all filter types that are used in the text format.

Return value

array All filter types used by filters of the text format.

Overrides FilterFormatInterface::getFilterTypes

File

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

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);
}