You are here

class SupportTicketRouteProvider in Support Ticketing System 8

Provides routes for support tickets.

Hierarchy

Expanded class hierarchy of SupportTicketRouteProvider

File

modules/support_ticket/src/Entity/SupportTicketRouteProvider.php, line 18
Contains \Drupal\support_ticket\Entity\SupportTicketRouteProvider.

Namespace

Drupal\support_ticket\Entity
View source
class SupportTicketRouteProvider implements EntityRouteProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function getRoutes(EntityTypeInterface $entity_type) {
    $route_collection = new RouteCollection();
    $route = (new Route('/support_ticket/{support_ticket}'))
      ->addDefaults([
      '_controller' => '\\Drupal\\support_ticket\\Controller\\SupportTicketViewController::view',
      '_title_callback' => '\\Drupal\\support_ticket\\Controller\\SupportTicketViewController::title',
    ])
      ->setRequirement('_entity_access', 'support_ticket.view');
    $route_collection
      ->add('entity.support_ticket.canonical', $route);
    $route = (new Route('/support_ticket/{support_ticket}/delete'))
      ->addDefaults([
      '_entity_form' => 'support_ticket.delete',
      '_title' => 'Delete',
    ])
      ->setRequirement('_entity_access', 'support_ticket.delete')
      ->setOption('_support_ticket_operation_route', TRUE);
    $route_collection
      ->add('entity.support_ticket.delete_form', $route);
    $route = (new Route('/support_ticket/{support_ticket}/edit'))
      ->setDefault('_entity_form', 'support_ticket.edit')
      ->setRequirement('_entity_access', 'support_ticket.update')
      ->setOption('_support_ticket_operation_route', TRUE);
    $route_collection
      ->add('entity.support_ticket.edit_form', $route);
    return $route_collection;
  }

}

Members