‪TYPO3CMS  ‪main
TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface:
TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\ExtensionPathSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\EmailSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\SubstituteSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkTagSoftReferenceParser TYPO3\CMS\Core\DataHandling\SoftReference\UrlSoftReferenceParser TYPO3\CMS\Form\SoftReference\FormPersistenceIdentifierSoftReferenceParser

Public Member Functions

SoftReferenceParserResult parse (string $table, string $field, int $uid, string $content, string $structurePath='')
 
 setParserKey (string $parserKey, array $parameters)
 
 getParserKey ()
 

Detailed Description

Soft Reference parsing interface

"Soft References" are references to database elements, files, email addresses, URLs etc. which are found in-text in content. The <a href="t3://page?[page_id]> tag from typical bodytext fields is an example of this. This interface defines the "parse" method, which parsers have to implement. TYPO3 has already implemented parsers for the most well-known types. Soft Reference Parsers can also be user-defined. The Soft Reference Parsers are used by the system to find these references and process them accordingly in import/export actions and copy operations.

Definition at line 30 of file SoftReferenceParserInterface.php.

Member Function Documentation

◆ getParserKey()

TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface::getParserKey ( )

◆ parse()

SoftReferenceParserResult TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface::parse ( string  $table,
string  $field,
int  $uid,
string  $content,
string  $structurePath = '' 
)

Main function through which can parse content for a specific field.

Parameters
string$tableDatabase table name
string$field‪Field name for which processing occurs
int$uid‪UID of the record
string$content‪The content/value of the field
string$structurePath‪If running from inside a FlexForm structure, this is the path of the tag.
Returns
SoftReferenceParserResult Result object on positive matches, see description above.
See also
SoftReferenceParserResult

Implemented in TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser, TYPO3\CMS\Form\SoftReference\FormPersistenceIdentifierSoftReferenceParser, TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkTagSoftReferenceParser, TYPO3\CMS\Core\DataHandling\SoftReference\ExtensionPathSoftReferenceParser, TYPO3\CMS\Core\DataHandling\SoftReference\UrlSoftReferenceParser, TYPO3\CMS\Core\DataHandling\SoftReference\EmailSoftReferenceParser, and TYPO3\CMS\Core\DataHandling\SoftReference\SubstituteSoftReferenceParser.

◆ setParserKey()

TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserInterface::setParserKey ( string  $parserKey,
array  $parameters 
)

The two properties parserKey and parameters may be set to generate a unique token ID from them. This is not needed for every parser, but useful if a parser can deal with multiple parser keys.

Parameters
string$parserKey‪The softref parser key.
array$parameters‪Parameters of the softlink parser. Basically this is the content inside optional []-brackets after the softref keys. Parameters are exploded by ";

Implemented in TYPO3\CMS\Core\DataHandling\SoftReference\ExtensionPathSoftReferenceParser, and TYPO3\CMS\Core\DataHandling\SoftReference\AbstractSoftReferenceParser.