You are here

public function CiviCrmEntityRouteProvider::getRoutes in CiviCRM Entity 8.3

Provides routes for entities.

Parameters

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

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides DefaultHtmlRouteProvider::getRoutes

File

src/Routing/CiviCrmEntityRouteProvider.php, line 17

Class

CiviCrmEntityRouteProvider
Provides routing for CiviCRM entities.

Namespace

Drupal\civicrm_entity\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->get('civicrm_entity_ui_exposed')) {
    return parent::getRoutes($entity_type);
  }
  return new RouteCollection();
}