class SimpleNodeParamConverter in Simple Node Importer 8
Hierarchy
- class \Drupal\simple_node_importer\ParamConverter\SimpleNodeParamConverter implements ParamConverterInterface
Expanded class hierarchy of SimpleNodeParamConverter
1 string reference to 'SimpleNodeParamConverter'
1 service uses SimpleNodeParamConverter
File
- src/
ParamConverter/ SimpleNodeParamConverter.php, line 11
Namespace
Drupal\simple_node_importer\ParamConverterView source
class SimpleNodeParamConverter implements ParamConverterInterface {
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
return \Drupal::entityManager()
->getStorage('node')
->load($value);
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
return !empty($definition['type']) && $definition['type'] == 'node';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimpleNodeParamConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
SimpleNodeParamConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |