You are here

class EdgeEntityRouteProvider in Apigee Edge 8

Default route provider for Apigee Edge entities.

Hierarchy

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\Entity
View 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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DefaultHtmlRouteProvider::$entityFieldManager protected property The entity field manager.
DefaultHtmlRouteProvider::$entityTypeManager protected property The entity type manager.
DefaultHtmlRouteProvider::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance 1
DefaultHtmlRouteProvider::getAddFormRoute protected function Gets the add-form route. 2
DefaultHtmlRouteProvider::getAddPageRoute protected function Gets the add page route. 2
DefaultHtmlRouteProvider::getCollectionRoute protected function Gets the collection route. 2
DefaultHtmlRouteProvider::getDeleteMultipleFormRoute protected function Returns the delete multiple form route. 1
DefaultHtmlRouteProvider::getEntityTypeIdKeyType protected function Gets the type of the ID key for a given entity type. 1
DefaultHtmlRouteProvider::getRoutes public function Provides routes for entities. Overrides EntityRouteProviderInterface::getRoutes 1
DefaultHtmlRouteProvider::__construct public function Constructs a new DefaultHtmlRouteProvider. 1
EdgeEntityRouteProvider::getCanonicalRoute protected function Gets the canonical route. Overrides DefaultHtmlRouteProvider::getCanonicalRoute 1
EdgeEntityRouteProvider::getDeleteFormRoute protected function Gets the delete-form route. Overrides DefaultHtmlRouteProvider::getDeleteFormRoute
EdgeEntityRouteProvider::getEditFormRoute protected function Gets the edit-form route. Overrides DefaultHtmlRouteProvider::getEditFormRoute