‪TYPO3CMS  ‪main
RecordRememberer.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 
21 
26 {
30  protected ‪$rememberedUids = [];
31 
32  public function ‪rememberRecords(iterable $records): void
33  {
34  foreach ($records as ‪$record) {
35  $this->‪rememberRecordUid((int)($record['uid'] ?? 0));
36  $this->‪rememberRecordUid((int)($record['l18n_parent'] ?? 0));
37  }
38  }
39 
40  public function ‪rememberRecordUid(int ‪$uid): void
41  {
42  $this->rememberedUids[‪$uid] = ‪$uid;
43  }
44 
45  public function ‪isRemembered(int ‪$uid): bool
46  {
47  return isset($this->rememberedUids[‪$uid]);
48  }
49 }
‪TYPO3\CMS\Backend\View\BackendLayout\RecordRememberer\rememberRecords
‪rememberRecords(iterable $records)
Definition: RecordRememberer.php:31
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Backend\View\BackendLayout\RecordRememberer\rememberRecordUid
‪rememberRecordUid(int $uid)
Definition: RecordRememberer.php:39
‪TYPO3\CMS\Backend\View\BackendLayout
Definition: BackendLayout.php:16
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪TYPO3\CMS\Backend\View\BackendLayout\RecordRememberer
Definition: RecordRememberer.php:26
‪TYPO3\CMS\Backend\View\BackendLayout\RecordRememberer\isRemembered
‪isRemembered(int $uid)
Definition: RecordRememberer.php:44
‪TYPO3\CMS\Backend\View\BackendLayout\RecordRememberer\$rememberedUids
‪int[] $rememberedUids
Definition: RecordRememberer.php:29