Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / filter / src / FilterFormatInterface.php
1 <?php
2
3 namespace Drupal\filter;
4
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6
7 /**
8  * Provides an interface defining a filter format entity.
9  */
10 interface FilterFormatInterface extends ConfigEntityInterface {
11
12   /**
13    * Returns the ordered collection of filter plugin instances or an individual plugin instance.
14    *
15    * @param string $instance_id
16    *   (optional) The ID of a filter plugin instance to return.
17    *
18    * @return \Drupal\filter\FilterPluginCollection|\Drupal\filter\Plugin\FilterInterface
19    *   Either the filter collection or a specific filter plugin instance.
20    */
21   public function filters($instance_id = NULL);
22
23   /**
24    * Sets the configuration for a filter plugin instance.
25    *
26    * Sets or replaces the configuration of a filter plugin in $this->filters,
27    * and if instantiated already, also ensures that the actual filter plugin on
28    * the FilterPluginCollection contains the identical configuration.
29    *
30    * @param string $instance_id
31    *   The ID of a filter plugin to set the configuration for.
32    * @param array $configuration
33    *   The filter plugin configuration to set.
34    */
35   public function setFilterConfig($instance_id, array $configuration);
36
37   /**
38    * Returns if this format is the fallback format.
39    *
40    * The fallback format can never be disabled. It must always be available.
41    *
42    * @return bool
43    *   TRUE if this format is the fallback format, FALSE otherwise.
44    */
45   public function isFallbackFormat();
46
47   /**
48    * Returns the machine-readable permission name for the text format.
49    *
50    * @return string|bool
51    *   The machine-readable permission name, or FALSE if the text format is
52    *   malformed or is the fallback format (which is available to all users).
53    */
54   public function getPermissionName();
55
56   /**
57    * Retrieves all filter types that are used in the text format.
58    *
59    * @return array
60    *   All filter types used by filters of the text format.
61    */
62   public function getFilterTypes();
63
64   /**
65    * Retrieve all HTML restrictions (tags and attributes) for the text format.
66    *
67    * Note that restrictions applied to the "*" tag (the wildcard tag, i.e. all
68    * tags) are treated just like any other HTML tag. That means that any
69    * restrictions applied to it are not automatically applied to all other tags.
70    * It is up to the caller to handle this in whatever way it sees fit; this way
71    * no information granularity is lost.
72    *
73    * @return array|false
74    *   A structured array as returned by FilterInterface::getHTMLRestrictions(),
75    *   but with the intersection of all filters in this text format.
76    *   Will either indicate blacklisting of tags or whitelisting of tags. In
77    *   the latter case, it's possible that restrictions on attributes are also
78    *   stored. FALSE means there are no HTML restrictions.
79    */
80   public function getHtmlRestrictions();
81
82   /**
83    * Removes a filter.
84    *
85    * @param string $instance_id
86    *   The ID of a filter plugin to be removed.
87    */
88   public function removeFilter($instance_id);
89
90 }