protected function GroupContentRouteProvider::getCanonicalRoute in Group 8
Same name and namespace in other branches
- 2.0.x src/Entity/Routing/GroupContentRouteProvider.php \Drupal\group\Entity\Routing\GroupContentRouteProvider::getCanonicalRoute()
Gets the canonical 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::getCanonicalRoute
File
- src/
Entity/ Routing/ GroupContentRouteProvider.php, line 147
Class
- GroupContentRouteProvider
- Provides routes for group content.
Namespace
Drupal\group\Entity\RoutingCode
protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
return parent::getCanonicalRoute($entity_type)
->setRequirement('_group_owns_content', 'TRUE')
->setOption('parameters', [
'group' => [
'type' => 'entity:group',
],
'group_content' => [
'type' => 'entity:group_content',
],
]);
}