public function DOI::buildUrl in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/src/Plugin/bibcite/link/DOI.php \Drupal\bibcite_entity\Plugin\bibcite\link\DOI::buildUrl()
Build URL object.
Parameters
\Drupal\bibcite_entity\Entity\ReferenceInterface $reference: Reference entity object.
Overrides BibciteLinkPluginBase::buildUrl
File
- modules/
bibcite_entity/ src/ Plugin/ bibcite/ link/ DOI.php, line 22
Class
- DOI
- Build DOI lookup link.
Namespace
Drupal\bibcite_entity\Plugin\bibcite\linkCode
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;
}