LinkProviderBase.php in JSON:API Hypermedia 8
File
src/Plugin/LinkProviderBase.php
View source
<?php
namespace Drupal\jsonapi_hypermedia\Plugin;
use Drupal\Core\Plugin\PluginBase;
use Drupal\jsonapi_hypermedia\LinkProviderInterface;
abstract class LinkProviderBase extends PluginBase implements LinkProviderInterface {
public function getLinkKey() {
$plugin_definition = $this
->getPluginDefinition();
return $plugin_definition['link_key'] ?? $this
->getLinkRelationType();
}
public function getLinkRelationType() {
$plugin_definition = $this
->getPluginDefinition();
return $plugin_definition['link_relation_type'];
}
}