You are here

public function TagSet::hasTag in Extensible BBCode 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Entity/TagSet.php \Drupal\xbbcode\Entity\TagSet::hasTag()

Check if a particular tag plugin is active.

Parameters

string $plugin_id: Plugin ID.

Return value

bool TRUE if the plugin is active in this tag set.

Overrides TagSetInterface::hasTag

File

src/Entity/TagSet.php, line 89

Class

TagSet
Represents a set of configured tags.

Namespace

Drupal\xbbcode\Entity

Code

public function hasTag(string $plugin_id) : bool {
  foreach ($this->tags as $tag) {
    if ($tag['id'] === $plugin_id) {
      return TRUE;
    }
  }
  return FALSE;
}