You are here

public static function Media::isApplicable in Linkit 8.5

Checks if this substitution plugin is applicable for the given entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: An entity type object.

Return value

bool If the plugin is applicable.

Overrides SubstitutionInterface::isApplicable

1 call to Media::isApplicable()
SubstitutionPluginTest::testMediaSubstitution in tests/src/Kernel/SubstitutionPluginTest.php
Test the media substitution.

File

src/Plugin/Linkit/Substitution/Media.php, line 68

Class

Media
A substitution plugin for the URL to a file.

Namespace

Drupal\linkit\Plugin\Linkit\Substitution

Code

public static function isApplicable(EntityTypeInterface $entity_type) {
  return $entity_type
    ->entityClassImplements('Drupal\\media\\MediaInterface');
}