FilterFormat::filters

public FilterFormat::filters($instance_id = NULL)

Returns the ordered collection of filter plugin instances or an individual plugin instance.

Parameters

string $instance_id: (optional) The ID of a filter plugin instance to return.

Return value

\Drupal\filter\FilterPluginCollection|\Drupal\filter\Plugin\FilterInterface Either the filter collection or a specific filter plugin instance.

Overrides FilterFormatInterface::filters

File

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

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Entity

Code

public function filters($instance_id = NULL) {
  if (!isset($this->filterCollection)) {
    $this->filterCollection = new FilterPluginCollection(\Drupal::service('plugin.manager.filter'), $this->filters);
    $this->filterCollection->sort();
  }
  if (isset($instance_id)) {
    return $this->filterCollection->get($instance_id);
  }
  return $this->filterCollection;
}
doc_Drupal
2016-10-29 09:14:31
Comments
Leave a Comment

Please login to continue.