class ParamNotConvertedException

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/ParamConverter/ParamNotConvertedException.php \Drupal\Core\ParamConverter\ParamNotConvertedException
  2. 10 core/lib/Drupal/Core/ParamConverter/ParamNotConvertedException.php \Drupal\Core\ParamConverter\ParamNotConvertedException
  3. 11.x core/lib/Drupal/Core/ParamConverter/ParamNotConvertedException.php \Drupal\Core\ParamConverter\ParamNotConvertedException

Provides an exception class for a request parameter that was not converted.

Hierarchy

Expanded class hierarchy of ParamNotConvertedException

10 files declare their use of ParamNotConvertedException
AccessManager.php in core/lib/Drupal/Core/Access/AccessManager.php
EntityConverterTest.php in core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
EntityRevisionParamConverterTest.php in core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php
NodeTranslationExceptionSubscriber.php in core/modules/node/src/EventSubscriber/NodeTranslationExceptionSubscriber.php
ParamConversionEnhancer.php in core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php

... See full list

File

core/lib/Drupal/Core/ParamConverter/ParamNotConvertedException.php, line 8

Namespace

Drupal\Core\ParamConverter
View source
class ParamNotConvertedException extends \Exception {
    
    /**
     * The route name that was not converted.
     *
     * @var string
     */
    protected $routeName = "";
    
    /**
     * The raw parameters that were not converted.
     *
     * @var array
     */
    protected $rawParameters = [];
    
    /**
     * Constructs the ParamNotConvertedException.
     *
     * @param string $message
     *   The Exception message to throw.
     * @param int $code
     *   The Exception code.
     * @param \Exception $previous
     *   The previous exception used for the exception chaining.
     * @param string $route_name
     *   The route name that was not converted.
     * @param array $raw_parameters
     *   The raw parameters that were not converted.
     */
    public function __construct($message = "", $code = 0, \Exception $previous = NULL, $route_name = "", array $raw_parameters = []) {
        parent::__construct($message, $code, $previous);
        $this->routeName = $route_name;
        $this->rawParameters = $raw_parameters;
    }
    
    /**
     * Get the route name that was not converted.
     *
     * @return string
     *   The route name that was not converted.
     */
    public function getRouteName() {
        return $this->routeName;
    }
    
    /**
     * Get the raw parameters that were not converted.
     *
     * @return array
     *   The raw parameters that were not converted.
     */
    public function getRawParameters() {
        return $this->rawParameters;
    }

}

Members

Title Sort descending Modifiers Object type Summary
ParamNotConvertedException::$rawParameters protected property The raw parameters that were not converted.
ParamNotConvertedException::$routeName protected property The route name that was not converted.
ParamNotConvertedException::getRawParameters public function Get the raw parameters that were not converted.
ParamNotConvertedException::getRouteName public function Get the route name that was not converted.
ParamNotConvertedException::__construct public function Constructs the ParamNotConvertedException.

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