class GoogleScholar in Bibliography & Citation 2.0.x
Same name and namespace in other branches
- 8 modules/bibcite_entity/src/Plugin/bibcite/link/GoogleScholar.php \Drupal\bibcite_entity\Plugin\bibcite\link\GoogleScholar
Build Google Scholar lookup link.
Plugin annotation
@BibciteLink(
id = "google_scholar",
label = @Translation("Google Scholar"),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\bibcite_entity\Plugin\BibciteLinkPluginBase implements BibciteLinkPluginInterface
- class \Drupal\bibcite_entity\Plugin\bibcite\link\GoogleScholar
- class \Drupal\bibcite_entity\Plugin\BibciteLinkPluginBase implements BibciteLinkPluginInterface
Expanded class hierarchy of GoogleScholar
File
- modules/
bibcite_entity/ src/ Plugin/ bibcite/ link/ GoogleScholar.php, line 17
Namespace
Drupal\bibcite_entity\Plugin\bibcite\linkView source
class GoogleScholar extends BibciteLinkPluginBase {
/**
* {@inheritdoc}
*/
public function buildUrl(ReferenceInterface $reference) {
$title_field = $reference
->get('title');
if (!$title_field
->isEmpty()) {
return Url::fromUri('https://scholar.google.com/scholar', [
'query' => [
'btnG' => 'Search+Scholar',
'as_q' => '"' . str_replace([
' ',
'(',
')',
], [
'+',
], $title_field->value) . '"',
'as_occt' => 'any',
'as_epq' => '',
'as_oq' => '',
'as_eq' => '',
'as_publication' => '',
'as_ylo' => '',
'as_yhi' => '',
'as_sdtAAP' => 1,
'as_sdtp' => 1,
],
]);
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BibciteLinkPluginBase:: |
public | function |
Build link using data from Reference entity. Overrides BibciteLinkPluginInterface:: |
|
BibciteLinkPluginBase:: |
public | function |
Get plugin label. Overrides BibciteLinkPluginInterface:: |
|
GoogleScholar:: |
public | function |
Build URL object. Overrides BibciteLinkPluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 98 |