‪TYPO3CMS  ‪main
SubstituteSoftReferenceParser.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  public function ‪parse(string $table, string $field, int ‪$uid, string $content, string $structurePath = ''): ‪SoftReferenceParserResult
26  {
27  $this->‪setTokenIdBasePrefix($table, (string)‪$uid, $field, $structurePath);
28  $tokenID = $this->‪makeTokenID();
29 
31  '{softref:' . $tokenID . '}',
32  [
33  [
34  'matchString' => $content,
35  'subst' => [
36  'type' => 'string',
37  'tokenID' => $tokenID,
38  'tokenValue' => $content,
39  ],
40  ],
41  ]
42  );
43  }
44 }
‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\setTokenIdBasePrefix
‪setTokenIdBasePrefix(string $table, string $uid, string $field, string $structurePath)
Definition: AbstractSoftReferenceParser.php:55
‪TYPO3\CMS\Core\DataHandling\SoftReference\SubstituteSoftReferenceParser\parse
‪parse(string $table, string $field, int $uid, string $content, string $structurePath='')
Definition: SubstituteSoftReferenceParser.php:25
‪TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult\create
‪static create(string $content, array $elements)
Definition: SoftReferenceParserResult.php:48
‪TYPO3\CMS\Core\DataHandling\SoftReference
Definition: AbstractSoftReferenceParser.php:18
‪TYPO3\CMS\Core\DataHandling\SoftReference\SubstituteSoftReferenceParser
Definition: SubstituteSoftReferenceParser.php:24
‪TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult
Definition: SoftReferenceParserResult.php:43
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\makeTokenID
‪string makeTokenID(string $index='')
Definition: AbstractSoftReferenceParser.php:35
‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser
Definition: AbstractSoftReferenceParser.php:24