function ParamConverterManager::getConverter

Same name in other branches
  1. 9 core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php \Drupal\Core\ParamConverter\ParamConverterManager::getConverter()
  2. 8.9.x core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php \Drupal\Core\ParamConverter\ParamConverterManager::getConverter()
  3. 11.x core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php \Drupal\Core\ParamConverter\ParamConverterManager::getConverter()

File

core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php, line 34

Class

ParamConverterManager
Manages converter services for converting request parameters to full objects.

Namespace

Drupal\Core\ParamConverter

Code

public function getConverter($converter) {
    if (isset($this->converters[$converter])) {
        return $this->converters[$converter];
    }
    else {
        throw new \InvalidArgumentException(sprintf('No converter has been registered for %s', $converter));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.