You are here

class SimpleNodeParamConverter in Simple Node Importer 8

Hierarchy

Expanded class hierarchy of SimpleNodeParamConverter

1 string reference to 'SimpleNodeParamConverter'
simple_node_importer.services.yml in ./simple_node_importer.services.yml
simple_node_importer.services.yml
1 service uses SimpleNodeParamConverter
node in ./simple_node_importer.services.yml
Drupal\simple_node_importer\ParamConverter\SimpleNodeParamConverter

File

src/ParamConverter/SimpleNodeParamConverter.php, line 11

Namespace

Drupal\simple_node_importer\ParamConverter
View 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

Namesort descending Modifiers Type Description Overrides
SimpleNodeParamConverter::applies public function Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface::applies
SimpleNodeParamConverter::convert public function Converts path variables to their corresponding objects. Overrides ParamConverterInterface::convert