function FilterFormatFormBase::exists

Same name and namespace in other branches
  1. 8.9.x core/modules/filter/src/FilterFormatFormBase.php \Drupal\filter\FilterFormatFormBase::exists()
  2. 10 core/modules/filter/src/FilterFormatFormBase.php \Drupal\filter\FilterFormatFormBase::exists()
  3. 11.x core/modules/filter/src/FilterFormatFormBase.php \Drupal\filter\FilterFormatFormBase::exists()

Determines if the format already exists.

Parameters

string $format_id: The format ID

Return value

bool TRUE if the format exists, FALSE otherwise.

File

core/modules/filter/src/FilterFormatFormBase.php, line 163

Class

FilterFormatFormBase
Provides a base form for a filter format.

Namespace

Drupal\filter

Code

public function exists($format_id) {
    return (bool) $this->entityTypeManager
        ->getStorage('filter_format')
        ->getQuery()
        ->condition('format', $format_id)
        ->execute();
}

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