class EdgeEntityRouteProvider in Apigee Edge 8
Default route provider for Apigee Edge entities.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\apigee_edge\Entity\EdgeEntityRouteProvider
Expanded class hierarchy of EdgeEntityRouteProvider
1 file declares its use of EdgeEntityRouteProvider
- TeamRouteProvider.php in modules/
apigee_edge_teams/ src/ Entity/ TeamRouteProvider.php
File
- src/
Entity/ EdgeEntityRouteProvider.php, line 29
Namespace
Drupal\apigee_edge\EntityView source
class EdgeEntityRouteProvider extends DefaultHtmlRouteProvider {
/**
* {@inheritdoc}
*/
protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
$route = parent::getCanonicalRoute($entity_type);
if ($route) {
$route
->setDefault('_title_callback', EdgeEntityTitleProvider::class . '::title');
}
return $route;
}
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
protected function getDeleteFormRoute(EntityTypeInterface $entity_type) {
$route = parent::getDeleteFormRoute($entity_type);
if ($route) {
$route
->setDefault('_title_callback', EdgeEntityTitleProvider::class . '::deleteTitle');
}
return $route;
}
}