You are here

public function AliasTypeManager::getPluginDefinitionByType in Pathauto 8

Returns plugin definitions that support a given token type.

Parameters

string $type: The type of token plugin must support to be useful.

Return value

array Plugin definitions.

File

src/AliasTypeManager.php, line 41

Class

AliasTypeManager
Manages pathauto alias type plugins.

Namespace

Drupal\pathauto

Code

public function getPluginDefinitionByType($type) {
  $definitions = array_filter($this
    ->getDefinitions(), function ($definition) use ($type) {
    if (!empty($definition['types']) && in_array($type, $definition['types'])) {
      return TRUE;
    }
    return FALSE;
  });
  return $definitions;
}