class BrokenHtmlRouteProvider in Entity Form Cancel Button 8
Provides HTML routes for test entity types defined in this module.
This class ensures (for testing) that the following routes are missing from EntityTestBrokenCanonicalRoute and EntityTestBrokenCollectionRoute: canonical, collection.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\cancel_button_test\Entity\Routing\BrokenHtmlRouteProvider
Expanded class hierarchy of BrokenHtmlRouteProvider
File
- tests/
modules/ cancel_button_test/ src/ Entity/ Routing/ BrokenHtmlRouteProvider.php, line 15
Namespace
Drupal\cancel_button_test\Entity\RoutingView source
class BrokenHtmlRouteProvider extends DefaultHtmlRouteProvider {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$collection = parent::getRoutes($entity_type);
$entity_type_id = $entity_type
->id();
if ($this
->getCanonicalRoute($entity_type)) {
$collection
->remove("entity.{$entity_type_id}.canonical");
}
if ($this
->getCollectionRoute($entity_type)) {
$collection
->remove("entity.{$entity_type_id}.collection");
}
return $collection;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrokenHtmlRouteProvider:: |
public | function |
Provides routes for entities. Overrides DefaultHtmlRouteProvider:: |
|
DefaultHtmlRouteProvider:: |
protected | property | The entity field manager. | |
DefaultHtmlRouteProvider:: |
protected | property | The entity type manager. | |
DefaultHtmlRouteProvider:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add-form route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add page route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the canonical route. | 3 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the collection route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the delete-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Returns the delete multiple form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the edit-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the type of the ID key for a given entity type. | 1 |
DefaultHtmlRouteProvider:: |
public | function | Constructs a new DefaultHtmlRouteProvider. | 1 |