‪TYPO3CMS  ‪main
IndexStatus.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 {
25  case MTIME_MATCHED;
26  case MINIMUM_AGE_NOT_EXCEEDED;
27  case MODIFICATION_TIME_DIFFERS;
28  case MODIFICATION_TIME_NOT_SET;
29  case NEW_DOCUMENT;
30 
31  public function ‪reason(): string
32  {
33  return match ($this) {
34  self::MTIME_MATCHED => 'mtime matched the document, so no changes detected and no content updated',
35  self::MINIMUM_AGE_NOT_EXCEEDED => 'The minimum age was not exceeded',
36  self::MODIFICATION_TIME_DIFFERS => 'The minimum age was exceed and mtime was set and the mtime was different, so the page was indexed',
37  self::MODIFICATION_TIME_NOT_SET => 'The minimum age was exceed, but mtime was not set, so the page was indexed',
38  self::NEW_DOCUMENT => 'Page has never been indexed (is not represented in the index_phash table)',
39  };
40  }
41 
42  public function reindexRequired(): bool
43  {
44  return match ($this) {
45  self::MTIME_MATCHED, self::MINIMUM_AGE_NOT_EXCEEDED => false,
46  default => true,
47  };
48  }
49 }
‪TYPO3\CMS\IndexedSearch\Type\reason
‪@ reason
Definition: IndexStatus.php:31
‪TYPO3\CMS\IndexedSearch\Type
Definition: DefaultOperand.php:18
‪TYPO3\CMS\IndexedSearch\Type\IndexStatus
‪IndexStatus
Definition: IndexStatus.php:24