‪TYPO3CMS  11.5
SoftReferenceIndex.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\EventDispatcher\EventDispatcherInterface;
23 
36 {
37  public string ‪$tokenID_basePrefix;
39 
40  public function ‪__construct(
41  EventDispatcherInterface ‪$eventDispatcher,
43  ) {
44  parent::__construct(‪$eventDispatcher);
45  $this->softReferenceParserFactory = ‪$softReferenceParserFactory;
46  trigger_error(
47  'SoftReferenceIndex will be removed in TYPO3 v12.0, use appropriate TYPO3\CMS\Core\DataHandling\SoftReference\* class instead.',
48  E_USER_DEPRECATED
49  );
50  }
51 
55  public function ‪findRef($table, $field, $uid, $content, $spKey, $spParams, $structurePath = '')
56  {
57  $this->parserKey = (string)$spKey;
58  $this->‪setTokenIdBasePrefix($table, (string)$uid, $field, $structurePath);
59 
60  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser($spKey);
61  $softReferenceParser->setParserKey($spKey, $spParams);
62  return $softReferenceParser->parse($table, $field, $uid, $content, $structurePath)->toNullableArray();
63  }
64 
65  public function ‪parse(string $table, string $field, int $uid, string $content, string $structurePath = ''): ‪SoftReferenceParserResult
66  {
67  // does nothing
69  }
70 
71  public function ‪setParserKey(string ‪$parserKey, array ‪$parameters): void
72  {
73  // does nothing
74  }
75 
86  public function ‪findRef_typolink($content, $spParams)
87  {
88  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser('typolink');
89  $softReferenceParser->setParserKey('typolink', (array)$spParams);
90  return $softReferenceParser->parse('', '', '', $content)->toNullableArray();
91  }
92 
102  public function ‪findRef_typolink_tag($content)
103  {
104  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser('typolink_tag');
105  $softReferenceParser->setParserKey('typolink_tag', []);
106  return $softReferenceParser->parse('', '', '', $content)->toNullableArray();
107  }
108 
116  public function ‪findRef_email($content, $spParams)
117  {
118  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser('email');
119  $softReferenceParser->setParserKey('email', (array)$spParams);
120  return $softReferenceParser->parse('', '', '', $content)->toNullableArray();
121  }
122 
130  public function ‪findRef_url($content, $spParams)
131  {
132  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser('url');
133  $softReferenceParser->setParserKey('url', (array)$spParams);
134  return $softReferenceParser->parse('', '', '', $content)->toNullableArray();
135  }
136 
143  public function ‪findRef_extension_fileref($content)
144  {
145  $softReferenceParser = $this->softReferenceParserFactory->getSoftReferenceParser('ext_fileref');
146  $softReferenceParser->setParserKey('ext_fileref', []);
147  return $softReferenceParser->parse('', '', '', $content)->toNullableArray();
148  }
149 }
‪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\SoftReferenceParserFactory
Definition: SoftReferenceParserFactory.php:28
‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\$parserKey
‪string $parserKey
Definition: AbstractSoftReferenceParser.php:26
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\$softReferenceParserFactory
‪SoftReferenceParserFactory $softReferenceParserFactory
Definition: SoftReferenceIndex.php:38
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\__construct
‪__construct(EventDispatcherInterface $eventDispatcher, SoftReferenceParserFactory $softReferenceParserFactory)
Definition: SoftReferenceIndex.php:40
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\setParserKey
‪setParserKey(string $parserKey, array $parameters)
Definition: SoftReferenceIndex.php:71
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef_email
‪array null findRef_email($content, $spParams)
Definition: SoftReferenceIndex.php:116
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\parse
‪parse(string $table, string $field, int $uid, string $content, string $structurePath='')
Definition: SoftReferenceIndex.php:65
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef_typolink_tag
‪array null findRef_typolink_tag($content)
Definition: SoftReferenceIndex.php:102
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef
‪findRef($table, $field, $uid, $content, $spKey, $spParams, $structurePath='')
Definition: SoftReferenceIndex.php:55
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef_url
‪array null findRef_url($content, $spParams)
Definition: SoftReferenceIndex.php:130
‪TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult\createWithoutMatches
‪static createWithoutMatches()
Definition: SoftReferenceParserResult.php:62
‪TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult
Definition: SoftReferenceParserResult.php:43
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef_extension_fileref
‪array null findRef_extension_fileref($content)
Definition: SoftReferenceIndex.php:143
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\$tokenID_basePrefix
‪string $tokenID_basePrefix
Definition: SoftReferenceIndex.php:37
‪TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser\$parameters
‪array $parameters
Definition: AbstractSoftReferenceParser.php:27
‪TYPO3\CMS\Core\Database\SoftReferenceIndex\findRef_typolink
‪array null findRef_typolink($content, $spParams)
Definition: SoftReferenceIndex.php:86
‪TYPO3\CMS\Core\Database\SoftReferenceIndex
Definition: SoftReferenceIndex.php:36
‪TYPO3\CMS\Core\Database
Definition: Connection.php:18