You are here

public function PluginTypeBasedConverterTrait::applies in Plugin 8.2

Implements \Drupal\Core\ParamConverter\ParamConverterInterface::applies().

File

src/ParamConverter/PluginTypeBasedConverterTrait.php, line 76

Class

PluginTypeBasedConverterTrait
Implements \Drupal\Core\ParamConverter\ParamConverterInterface for plugin type-based route parameter converters.

Namespace

Drupal\plugin\ParamConverter

Code

public function applies($definition, $name, Route $route) {
  $valid = $this
    ->validateParameterDefinition($definition);
  if (!$valid) {
    return FALSE;
  }
  if (is_null($this
    ->getConverterDefinition($definition))) {
    return FALSE;
  }
  return TRUE;
}