public function ParamConverterManager::getConverter in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php \Drupal\Core\ParamConverter\ParamConverterManager::getConverter()
Lazy-loads converter services.
Parameters
string $id: The service id of converter service to load.
Return value
\Drupal\Core\ParamConverter\ParamConverterInterface The loaded converter service identified by the given service id.
Throws
\InvalidArgumentException If the given service id is not a registered converter.
Overrides ParamConverterManagerInterface::getConverter
File
- core/
lib/ Drupal/ Core/ ParamConverter/ ParamConverterManager.php, line 39 - Contains \Drupal\Core\ParamConverter\ParamConverterManager.
Class
- ParamConverterManager
- Manages converter services for converting request parameters to full objects.
Namespace
Drupal\Core\ParamConverterCode
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));
}
}