Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityResolverManager.php

function EntityResolverManager::setRouteOptions

Set the upcasting route objects.

Parameters

\Symfony\Component\Routing\Route $route: The route object to add the upcasting information onto.

File

core/lib/Drupal/Core/Entity/EntityResolverManager.php, line 218

Class

EntityResolverManager
Sets the entity route parameter converter options automatically.

Namespace

Drupal\Core\Entity

Code

public function setRouteOptions(Route $route) {
    if ($controller = $this->getControllerClass($route->getDefaults())) {
        // Try to use reflection.
        if ($this->setParametersFromReflection($controller, $route)) {
            return;
        }
    }
    // Try to use _entity_* information on the route.
    $this->setParametersFromEntityInformation($route);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal