You are here

interface SubstitutionInterface in Linkit 8.5

Interface for substitution plugins.

Hierarchy

Expanded class hierarchy of SubstitutionInterface

All classes that implement SubstitutionInterface

3 files declare their use of SubstitutionInterface
Canonical.php in src/Plugin/Linkit/Substitution/Canonical.php
File.php in src/Plugin/Linkit/Substitution/File.php
Media.php in src/Plugin/Linkit/Substitution/Media.php

File

src/SubstitutionInterface.php, line 12

Namespace

Drupal\linkit
View source
interface SubstitutionInterface extends PluginInspectionInterface {

  /**
   * Get the URL associated with a given entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to get a URL for.
   *
   * @return \Drupal\Core\GeneratedUrl
   *   A url to replace.
   */
  public function getUrl(EntityInterface $entity);

  /**
   * Checks if this substitution plugin is applicable for the given entity type.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
   *   An entity type object.
   *
   * @return bool
   *   If the plugin is applicable.
   */
  public static function isApplicable(EntityTypeInterface $entity_type);

}

Members

Namesort descending Modifiers Type Description Overrides
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
SubstitutionInterface::getUrl public function Get the URL associated with a given entity. 3
SubstitutionInterface::isApplicable public static function Checks if this substitution plugin is applicable for the given entity type. 3