You are here

abstract class BibciteLinkPluginBase in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Plugin/BibciteLinkPluginBase.php \Drupal\bibcite_entity\Plugin\BibciteLinkPluginBase

Base class for Link plugins.

Hierarchy

Expanded class hierarchy of BibciteLinkPluginBase

4 files declare their use of BibciteLinkPluginBase
DOI.php in modules/bibcite_entity/src/Plugin/bibcite/link/DOI.php
Export.php in modules/bibcite_export/src/Plugin/bibcite/link/Export.php
GoogleScholar.php in modules/bibcite_entity/src/Plugin/bibcite/link/GoogleScholar.php
PubMed.php in modules/bibcite_entity/src/Plugin/bibcite/link/PubMed.php

File

modules/bibcite_entity/src/Plugin/BibciteLinkPluginBase.php, line 12

Namespace

Drupal\bibcite_entity\Plugin
View source
abstract class BibciteLinkPluginBase extends PluginBase implements BibciteLinkPluginInterface {

  /**
   * {@inheritdoc}
   */
  public function getLabel() {
    return $this->pluginDefinition['label'];
  }

  /**
   * Build URL object.
   *
   * @param \Drupal\bibcite_entity\Entity\ReferenceInterface $reference
   *   Reference entity object.
   */
  protected function buildUrl(ReferenceInterface $reference) {
  }

  /**
   * {@inheritdoc}
   */
  public function build(ReferenceInterface $reference) {
    if ($url = $this
      ->buildUrl($reference)) {
      return Link::fromTextAndUrl($this
        ->getLabel(), $url)
        ->toRenderable();
    }
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BibciteLinkPluginBase::build public function Build link using data from Reference entity. Overrides BibciteLinkPluginInterface::build
BibciteLinkPluginBase::buildUrl protected function Build URL object. 4
BibciteLinkPluginBase::getLabel public function Get plugin label. Overrides BibciteLinkPluginInterface::getLabel
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 92