You are here

class DOI in Bibliography & Citation 8

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

Build DOI lookup link.

Plugin annotation


@BibciteLink(
  id = "doi",
  label = @Translation("DOI"),
)

Hierarchy

Expanded class hierarchy of DOI

2 string references to 'DOI'
CslMappingForm::buildForm in modules/bibcite_entity/src/Form/CslMappingForm.php
Form constructor.
Reference::baseFieldDefinitions in modules/bibcite_entity/src/Entity/Reference.php
Provides base field definitions for an entity type.

File

modules/bibcite_entity/src/Plugin/bibcite/link/DOI.php, line 17

Namespace

Drupal\bibcite_entity\Plugin\bibcite\link
View source
class DOI extends BibciteLinkPluginBase {

  /**
   * {@inheritdoc}
   */
  public function buildUrl(ReferenceInterface $reference) {
    $doi_field = $reference
      ->get('bibcite_doi');
    if (!$doi_field
      ->isEmpty()) {
      return Url::fromUri("http://dx.doi.org/{$doi_field->value}");
    }
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BibciteLinkPluginBase::build public function Build link using data from Reference entity. Overrides BibciteLinkPluginInterface::build
BibciteLinkPluginBase::getLabel public function Get plugin label. Overrides BibciteLinkPluginInterface::getLabel
DOI::buildUrl public function Build URL object. Overrides BibciteLinkPluginBase::buildUrl
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