You are here

interface ParamConverterManagerInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/ParamConverter/ParamConverterManagerInterface.php \Drupal\Core\ParamConverter\ParamConverterManagerInterface

Provides an interface for a parameter converter manager.

Hierarchy

Expanded class hierarchy of ParamConverterManagerInterface

All classes that implement ParamConverterManagerInterface

3 files declare their use of ParamConverterManagerInterface
AccessManager.php in core/lib/Drupal/Core/Access/AccessManager.php
Contains \Drupal\Core\Access\AccessManager.
ParamConversionEnhancer.php in core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
Contains \Drupal\Core\Routing\Enhancer\ParamConversionEnhancer.
ParamConverterSubscriber.php in core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php
Contains \Drupal\Core\EventSubscriber\ParamConverterSubscriber.

File

core/lib/Drupal/Core/ParamConverter/ParamConverterManagerInterface.php, line 15
Contains \Drupal\Core\ParamConverter\ParamConverterManagerInterface.

Namespace

Drupal\Core\ParamConverter
View source
interface ParamConverterManagerInterface {

  /**
   * Registers a parameter converter with the manager.
   *
   * @param \Drupal\Core\ParamConverter\ParamConverterInterface $param_converter
   *   The added param converter instance.
   * @param string $id
   *   The parameter converter service id to register.
   *
   * @return $this
   */
  public function addConverter(ParamConverterInterface $param_converter, $id);

  /**
   * Lazy-loads converter services.
   *
   * @param string $id
   *   The service id of converter service to load.
   *
   * @return \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.
   */
  public function getConverter($id);

  /**
   * Saves a list of applicable converters to each route.
   *
   * @param \Symfony\Component\Routing\RouteCollection $routes
   *   A collection of routes to apply converters to.
   */
  public function setRouteParameterConverters(RouteCollection $routes);

  /**
   * Invokes the registered converter for each defined parameter on a route.
   *
   * @param array $defaults
   *   The route defaults array.
   *
   * @return array
   *   The modified defaults.
   *
   * @throws \Drupal\Core\ParamConverter\ParamNotConvertedException
   *   If one of the assigned converters returned NULL because the given
   *   variable could not be converted.
   */
  public function convert(array $defaults);

}

Members

Namesort descending Modifiers Type Description Overrides
ParamConverterManagerInterface::addConverter public function Registers a parameter converter with the manager. 1
ParamConverterManagerInterface::convert public function Invokes the registered converter for each defined parameter on a route. 1
ParamConverterManagerInterface::getConverter public function Lazy-loads converter services. 1
ParamConverterManagerInterface::setRouteParameterConverters public function Saves a list of applicable converters to each route. 1