‪TYPO3CMS  11.5
TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory Class Reference

Public Member Functions

 __construct (FrontendInterface $runtimeCache, LoggerInterface $logger)
 
 addParser (SoftReferenceParserInterface $softReferenceParser, string $parserKey)
 
iterable< SoftReferenceParserInterfacegetParsersBySoftRefParserList (string $softRefParserList, ?array $forcedParameters=null)
 
bool hasSoftReferenceParser (string $softReferenceParserKey)
 
SoftReferenceParserInterface getSoftReferenceParser (string $softReferenceParserKey)
 
 getSoftReferenceParsers ()
 

Protected Member Functions

array null explodeSoftRefParserList (string $parserList)
 

Protected Attributes

array $softReferenceParsers = []
 
FrontendInterface $runtimeCache
 
LoggerInterface $logger
 

Detailed Description

Factory class for soft reference parsers

Definition at line 27 of file SoftReferenceParserFactory.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addParser()

TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::addParser ( SoftReferenceParserInterface  $softReferenceParser,
string  $parserKey 
)

Adds a parser via DI.

Parameters
SoftReferenceParserInterface$softReferenceParser
string$parserKey

Definition at line 59 of file SoftReferenceParserFactory.php.

◆ explodeSoftRefParserList()

array null TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::explodeSoftRefParserList ( string  $parserList)
protected

Returns array of soft parser references

Parameters
string$parserList‪softRef parser list
Returns
‪array|null Array where the parser key is the key and the value is the parameter string, FALSE if no parsers were found

Definition at line 72 of file SoftReferenceParserFactory.php.

References $output, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory\getParsersBySoftRefParserList().

◆ getParsersBySoftRefParserList()

iterable<SoftReferenceParserInterface> TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::getParsersBySoftRefParserList ( string  $softRefParserList,
?array  $forcedParameters = null 
)

◆ getSoftReferenceParser()

SoftReferenceParserInterface TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::getSoftReferenceParser ( string  $softReferenceParserKey)

Get a Soft Reference Parser by the given soft reference key. Implementation must be registered in Configuration/Services.yaml

VENDOR\YourExtension\SoftReference\UserDefinedSoftReferenceParser: tags:

  • ‪name: softreference.parser parserKey: userdefined
Parameters
string$softReferenceParserKey
Returns
SoftReferenceParserInterface

Definition at line 144 of file SoftReferenceParserFactory.php.

References $parser, TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory\__construct(), TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult\create(), TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserResult\createWithoutMatches(), and TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory\hasSoftReferenceParser().

Referenced by TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory\getParsersBySoftRefParserList().

◆ getSoftReferenceParsers()

TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::getSoftReferenceParsers ( )

Get all registered soft reference parsers

Definition at line 220 of file SoftReferenceParserFactory.php.

References TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory\$softReferenceParsers.

◆ hasSoftReferenceParser()

bool TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::hasSoftReferenceParser ( string  $softReferenceParserKey)

Member Data Documentation

◆ $logger

LoggerInterface TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::$logger
protected

◆ $runtimeCache

FrontendInterface TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::$runtimeCache
protected

◆ $softReferenceParsers

array TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory::$softReferenceParsers = []
protected