class NumberPatternRouteProvider in Commerce Core 8.2
Defines the route provider for number patterns.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\entity\Routing\DefaultHtmlRouteProvider
- class \Drupal\commerce_number_pattern\NumberPatternRouteProvider
- class \Drupal\entity\Routing\DefaultHtmlRouteProvider
Expanded class hierarchy of NumberPatternRouteProvider
File
- modules/
number_pattern/ src/ NumberPatternRouteProvider.php, line 12
Namespace
Drupal\commerce_number_patternView source
class NumberPatternRouteProvider extends DefaultHtmlRouteProvider {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$collection = parent::getRoutes($entity_type);
if ($reset_sequence_form_route = $this
->getResetSequenceFormRoute($entity_type)) {
$collection
->add("entity.commerce_number_pattern.reset_sequence_form", $reset_sequence_form_route);
}
return $collection;
}
/**
* Gets the reset-sequence-form route.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type.
*
* @return \Symfony\Component\Routing\Route|null
* The generated route, if available.
*/
protected function getResetSequenceFormRoute(EntityTypeInterface $entity_type) {
$route = new Route($entity_type
->getLinkTemplate('reset-sequence-form'));
$route
->addDefaults([
'_entity_form' => 'commerce_number_pattern.reset-sequence',
'_title' => 'Reset sequence',
])
->setRequirement('_entity_access', 'commerce_number_pattern.reset_sequence')
->setOption('parameters', [
'commerce_number_pattern' => [
'type' => 'entity:commerce_number_pattern',
],
]);
return $route;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. Overrides DefaultHtmlRouteProvider:: |
|
DefaultHtmlRouteProvider:: |
protected | function | Gets the delete-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Returns the delete multiple form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the duplicate-form route. | |
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 |
NumberPatternRouteProvider:: |
protected | function | Gets the reset-sequence-form route. | |
NumberPatternRouteProvider:: |
public | function |
Provides routes for entities. Overrides DefaultHtmlRouteProvider:: |