You are here

class LinkRelationType in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Http/LinkRelationType.php \Drupal\Core\Http\LinkRelationType
  2. 9 core/lib/Drupal/Core/Http/LinkRelationType.php \Drupal\Core\Http\LinkRelationType

Defines a single link relationship type.

Hierarchy

Expanded class hierarchy of LinkRelationType

1 file declares its use of LinkRelationType
LinkRelationsTest.php in core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php

File

core/lib/Drupal/Core/Http/LinkRelationType.php, line 10

Namespace

Drupal\Core\Http
View source
class LinkRelationType extends PluginBase implements LinkRelationTypeInterface {

  /**
   * {@inheritdoc}
   */
  public function isRegistered() {
    return !$this
      ->isExtension();
  }

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

  /**
   * {@inheritdoc}
   */
  public function getRegisteredName() {
    return $this
      ->isRegistered() ? $this
      ->getPluginId() : NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getExtensionUri() {
    return $this
      ->isExtension() ? $this->pluginDefinition['uri'] : NULL;
  }

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

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

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

}

Members