‪TYPO3CMS  ‪main
DeleteIndexedData.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 
23 
28 {
29  public function delete(array $params): void
30  {
31  if (isset($params['uid_page']) && $this->‪isEnabled()) {
32  $administrationRepository = GeneralUtility::makeInstance(AdministrationRepository::class);
33  $administrationRepository->removeIndexedPhashRow('ALL', $params['uid_page'], 0);
34  }
35  }
36 
37  protected function ‪isEnabled(): bool
38  {
39  try {
40  return (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('indexed_search', 'deleteFromIndexAfterEditing');
41  } catch (\Exception $e) {
42  // do nothing
43  }
44  return false;
45  }
46 }
‪TYPO3\CMS\Core\Configuration\ExtensionConfiguration
Definition: ExtensionConfiguration.php:47
‪TYPO3\CMS\IndexedSearch\Hook\DeleteIndexedData\isEnabled
‪isEnabled()
Definition: DeleteIndexedData.php:37
‪TYPO3\CMS\IndexedSearch\Hook\DeleteIndexedData
Definition: DeleteIndexedData.php:28
‪TYPO3\CMS\IndexedSearch\Domain\Repository\AdministrationRepository
Definition: AdministrationRepository.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\IndexedSearch\Hook
Definition: AvailableTcaTables.php:18