SoftReferenceParserFactory
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $logger : LoggerInterface
- $runtimeCache : FrontendInterface
- $softReferenceParsers : array<string|int, mixed>
Methods
- __construct() : mixed
- addParser() : void
- Adds a parser via DI.
- getParsersBySoftRefParserList() : iterable<string|int, SoftReferenceParserInterface>
- getSoftReferenceParser() : SoftReferenceParserInterface
- Get a Soft Reference Parser by the given soft reference key.
- getSoftReferenceParsers() : array<string|int, mixed>
- Get all registered soft reference parsers
- hasSoftReferenceParser() : bool
- explodeSoftRefParserList() : array<string|int, mixed>|null
- Returns array of soft parser references
Properties
$logger read-only
protected
LoggerInterface
$logger
$runtimeCache read-only
protected
FrontendInterface
$runtimeCache
Attributes
- #[Autowire]
- $service: 'cache.runtime'
$softReferenceParsers
protected
array<string|int, mixed>
$softReferenceParsers
= []
Methods
__construct()
public
__construct(FrontendInterface $runtimeCache, LoggerInterface $logger) : mixed
Parameters
- $runtimeCache : FrontendInterface
- $logger : LoggerInterface
addParser()
Adds a parser via DI.
public
addParser(SoftReferenceParserInterface $softReferenceParser, string $parserKey) : void
Parameters
- $softReferenceParser : SoftReferenceParserInterface
- $parserKey : string
getParsersBySoftRefParserList()
public
getParsersBySoftRefParserList(string $softRefParserList[, array<string|int, mixed>|null $forcedParameters = null ]) : iterable<string|int, SoftReferenceParserInterface>
Parameters
- $softRefParserList : string
- $forcedParameters : array<string|int, mixed>|null = null
Return values
iterable<string|int, SoftReferenceParserInterface>getSoftReferenceParser()
Get a Soft Reference Parser by the given soft reference key.
public
getSoftReferenceParser(string $softReferenceParserKey) : SoftReferenceParserInterface
Implementation must be registered in Configuration/Services.yaml
VENDOR\YourExtension\SoftReference\UserDefinedSoftReferenceParser: tags: - name: softreference.parser parserKey: userdefined
Parameters
- $softReferenceParserKey : string
Return values
SoftReferenceParserInterfacegetSoftReferenceParsers()
Get all registered soft reference parsers
public
getSoftReferenceParsers() : array<string|int, mixed>
Return values
array<string|int, mixed>hasSoftReferenceParser()
public
hasSoftReferenceParser(string $softReferenceParserKey) : bool
Parameters
- $softReferenceParserKey : string
Return values
boolexplodeSoftRefParserList()
Returns array of soft parser references
protected
explodeSoftRefParserList(string $parserList) : array<string|int, mixed>|null
Parameters
- $parserList : string
-
softRef parser list
Return values
array<string|int, mixed>|null —Array where the parser key is the key and the value is the parameter string, FALSE if no parsers were found