Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Access / CheckProviderInterface.php
1 <?php
2
3 namespace Drupal\Core\Access;
4
5 use Symfony\Component\Routing\RouteCollection;
6
7 /**
8  * Provides the available access checkers by service IDs.
9  *
10  * Access checker services are added by ::addCheckService calls and are loaded
11  * by ::loadCheck.
12  *
13  * The checker provider service and the actual checking is separated in order
14  * to not require the full access manager on route build time.
15  */
16 interface CheckProviderInterface {
17
18   /**
19    * For each route, saves a list of applicable access checks to the route.
20    *
21    * @param \Symfony\Component\Routing\RouteCollection $routes
22    *   A collection of routes to apply checks to.
23    */
24   public function setChecks(RouteCollection $routes);
25
26   /**
27    * Registers a new AccessCheck by service ID.
28    *
29    * @param string $service_id
30    *   The ID of the service in the Container that provides a check.
31    * @param string $service_method
32    *   The method to invoke on the service object for performing the check.
33    * @param array $applies_checks
34    *   (optional) An array of route requirement keys the checker service applies
35    *   to.
36    * @param bool $needs_incoming_request
37    *   (optional) True if access-check method only acts on an incoming request.
38    */
39   public function addCheckService($service_id, $service_method, array $applies_checks = [], $needs_incoming_request = FALSE);
40
41   /**
42    * Lazy-loads access check services.
43    *
44    * @param string $service_id
45    *   The service id of the access check service to load.
46    *
47    * @return callable
48    *   A callable access check.
49    *
50    * @throws \InvalidArgumentException
51    *   Thrown when the service hasn't been registered in addCheckService().
52    * @throws \Drupal\Core\Access\AccessException
53    *   Thrown when the service doesn't implement the required interface.
54    */
55   public function loadCheck($service_id);
56
57   /**
58    * A list of checks that needs the request.
59    *
60    * @return array
61    */
62   public function getChecksNeedRequest();
63
64 }