LinkRelationType.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Http/LinkRelationType.php
  2. 8.9.x core/lib/Drupal/Core/Http/LinkRelationType.php
  3. 11.x core/lib/Drupal/Core/Http/LinkRelationType.php

Namespace

Drupal\Core\Http

File

core/lib/Drupal/Core/Http/LinkRelationType.php

View source
<?php

namespace Drupal\Core\Http;

use Drupal\Core\Plugin\PluginBase;

/**
 * Defines a single link relationship type.
 */
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'] ?? '';
    }

}

Classes

Title Deprecated Summary
LinkRelationType Defines a single link relationship type.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.