You are here

protected function EntityTagPlugin::getEntity in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Plugin/XBBCode/EntityTagPlugin.php \Drupal\xbbcode\Plugin\XBBCode\EntityTagPlugin::getEntity()

Loads the custom tag entity of the plugin.

Return value

\Drupal\xbbcode\Entity\TagInterface The custom tag entity.

2 calls to EntityTagPlugin::getEntity()
EntityTagPlugin::doProcess in src/Plugin/XBBCode/EntityTagPlugin.php
Create the actual output.
EntityTagPlugin::getTemplate in src/Plugin/XBBCode/EntityTagPlugin.php
Get the tag template.

File

src/Plugin/XBBCode/EntityTagPlugin.php, line 121

Class

EntityTagPlugin
A tag plugin based on a custom tag entity.

Namespace

Drupal\xbbcode\Plugin\XBBCode

Code

protected function getEntity() : TagInterface {
  if (!$this->entity) {
    $id = $this
      ->getDerivativeId();
    $this->entity = $this->storage
      ->load($id);
  }
  return $this->entity;
}