Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / entity / src / Routing / DeleteMultipleRouteProvider.php
1 <?php
2
3 namespace Drupal\entity\Routing;
4
5 use Drupal\Core\Entity\EntityTypeInterface;
6 use Drupal\Core\Entity\Routing\EntityRouteProviderInterface;
7 use Symfony\Component\Routing\Route;
8 use Symfony\Component\Routing\RouteCollection;
9
10 /**
11  * Provides the HTML route for deleting multiple entities.
12  */
13 class DeleteMultipleRouteProvider implements EntityRouteProviderInterface {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getRoutes(EntityTypeInterface $entity_type) {
19     $routes = new RouteCollection();
20     if ($route = $this->deleteMultipleFormRoute($entity_type)) {
21       $routes->add('entity.' . $entity_type->id() . '.delete_multiple_form', $route);
22     }
23
24     return $routes;
25   }
26
27   /**
28    * Returns the delete multiple form route.
29    *
30    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
31    *   The entity type.
32    *
33    * @return \Symfony\Component\Routing\Route|null
34    *   The generated route, if available.
35    */
36   protected function deleteMultipleFormRoute(EntityTypeInterface $entity_type) {
37     if ($entity_type->hasLinkTemplate('delete-multiple-form')) {
38       $route = new Route($entity_type->getLinkTemplate('delete-multiple-form'));
39       $route->setDefault('_form', '\Drupal\entity\Form\DeleteMultipleForm');
40       $route->setDefault('entity_type_id', $entity_type->id());
41       $route->setRequirement('_entity_delete_multiple_access', $entity_type->id());
42
43       return $route;
44     }
45   }
46
47 }