27bc56de54325241db67a477c0bfba040e7bc980
[yaffs-website] / src / RedirectNotFoundStorageInterface.php
1 <?php
2
3 namespace Drupal\redirect_404;
4
5 /**
6  * Interface for redirect 404 services.
7  */
8 interface RedirectNotFoundStorageInterface {
9
10   /**
11    * Merges a 404 request log in the database.
12    *
13    * @param string $path
14    *   The path of the current request.
15    * @param string $langcode
16    *   The ID of the language code.
17    */
18   public function logRequest($path, $langcode);
19
20   /**
21    * Marks a 404 request log as resolved.
22    *
23    * @param string $path
24    *   The path of the current request.
25    * @param string $langcode
26    *   The ID of the language code.
27    */
28   public function resolveLogRequest($path, $langcode);
29
30   /**
31    * Returns the 404 request data.
32    *
33    * @param array $header
34    *   An array containing arrays of the redirect_404 fields data.
35    * @param string $search
36    *   The search text. It is possible to have multiple '*' as a wildcard.
37    *
38    * @return array
39    *   A list of objects with the properties:
40    *   - path
41    *   - count
42    *   - timestamp
43    *   - langcode
44    *   - resolved
45    */
46   public function listRequests(array $header = [], $search = NULL);
47
48   /**
49    * Cleans the irrelevant 404 request logs.
50    */
51   public function purgeOldRequests();
52
53 }