You are here

protected function EdgeEntityRouteProvider::getEditFormRoute in Apigee Edge 8

Gets the edit-form route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getEditFormRoute

File

src/Entity/EdgeEntityRouteProvider.php, line 45

Class

EdgeEntityRouteProvider
Default route provider for Apigee Edge entities.

Namespace

Drupal\apigee_edge\Entity

Code

protected function getEditFormRoute(EntityTypeInterface $entity_type) {
  $route = parent::getEditFormRoute($entity_type);
  if ($route) {
    $route
      ->setDefault('_title_callback', EdgeEntityTitleProvider::class . '::editTitle');

    // We must load the entity from Apigee Edge directly and omit cached
    // version on edit forms.
    $route
      ->setOption('apigee_edge_load_unchanged_entity', 'true');
  }
  return $route;
}