‪TYPO3CMS  ‪main
ReactionInstruction.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 
22 
27 {
28  public function ‪__construct(
29  protected array ‪$record
30  ) {}
31 
32  public function ‪getUid(): int
33  {
34  return $this->record['uid'];
35  }
36 
37  public function ‪getName(): string
38  {
39  return $this->record['name'];
40  }
41 
42  public function ‪getType(): string
43  {
44  return $this->record['reaction_type'];
45  }
46 
47  public function ‪getIdentifier(): string
48  {
49  return $this->record['identifier'];
50  }
51 
52  public function ‪getImpersonateUser(): int
53  {
54  return $this->record['impersonate_user'];
55  }
56 
57  public function ‪isSecretValid(string $secret): bool
58  {
59  $hashInstance = GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance('BE');
60  return $hashInstance->checkPassword($secret, $this->record['secret']);
61  }
62 
63  public function ‪toArray(): array
64  {
65  return ‪$this->record;
66  }
67 }
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory
Definition: PasswordHashFactory.php:27
‪TYPO3\CMS\Reactions\Model\ReactionInstruction
Definition: ReactionInstruction.php:27
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\__construct
‪__construct(protected array $record)
Definition: ReactionInstruction.php:28
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\toArray
‪toArray()
Definition: ReactionInstruction.php:63
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\getType
‪getType()
Definition: ReactionInstruction.php:42
‪TYPO3\CMS\Reactions\Model
Definition: ReactionInstruction.php:18
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\getIdentifier
‪getIdentifier()
Definition: ReactionInstruction.php:47
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\getImpersonateUser
‪getImpersonateUser()
Definition: ReactionInstruction.php:52
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\getName
‪getName()
Definition: ReactionInstruction.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\getUid
‪getUid()
Definition: ReactionInstruction.php:32
‪TYPO3\CMS\Reactions\Model\ReactionInstruction\isSecretValid
‪isSecretValid(string $secret)
Definition: ReactionInstruction.php:57