You are here

public function Editor::getFilterFormat in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::getFilterFormat()
  2. 9 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::getFilterFormat()

Returns the filter format this text editor is associated with.

This could be NULL if the associated filter format is still being created.

Return value

\Drupal\filter\FilterFormatInterface|null

Overrides EditorInterface::getFilterFormat

See also

hasAssociatedFilterFormat()

2 calls to Editor::getFilterFormat()
Editor::calculateDependencies in core/modules/editor/src/Entity/Editor.php
Calculates dependencies and stores them in the dependency property.
Editor::label in core/modules/editor/src/Entity/Editor.php
Gets the label of the entity.

File

core/modules/editor/src/Entity/Editor.php, line 128

Class

Editor
Defines the configured text editor entity.

Namespace

Drupal\editor\Entity

Code

public function getFilterFormat() {
  if (!$this->filterFormat) {
    $this->filterFormat = \Drupal::entityTypeManager()
      ->getStorage('filter_format')
      ->load($this->format);
  }
  return $this->filterFormat;
}