You are here

protected function DeveloperAppRouteProvider::getEditFormRouteForDeveloper in Apigee Edge 8

Gets the edit-form route for a developer.

Parameters

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

Return value

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

1 call to DeveloperAppRouteProvider::getEditFormRouteForDeveloper()
DeveloperAppRouteProvider::getRoutes in src/Entity/DeveloperAppRouteProvider.php
Provides routes for entities.

File

src/Entity/DeveloperAppRouteProvider.php, line 147

Class

DeveloperAppRouteProvider
Default entity routes for developer apps.

Namespace

Drupal\apigee_edge\Entity

Code

protected function getEditFormRouteForDeveloper(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('edit-form-for-developer')) {
    $route = new Route($entity_type
      ->getLinkTemplate('edit-form-for-developer'));
    $route
      ->setDefault('_entity_form', 'developer_app.edit_for_developer');
    $route
      ->setDefault('_title_callback', AppTitleProvider::class . '::editTitle');
    $route
      ->setDefault('entity_type_id', $entity_type
      ->id());
    $this
      ->ensureUserParameter($route);
    $route
      ->setRequirement('_app_access_check_by_app_name', 'update');

    // 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;
  }
}