Skip to content

Commit

Permalink
[TASK] Add info about using SoftRefParser (#1030)
Browse files Browse the repository at this point in the history
See Breaking 88638 
See #849
  • Loading branch information
susannemoog committed Oct 12, 2020
1 parent 02a3929 commit 166709f
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions Documentation/ApiOverview/SoftReferences/Index.rst
Expand Up @@ -155,22 +155,20 @@ The default set up is found in :file:`typo3/sysext/core/Configuration/DefaultCon

.. code-block:: php
'SC_OPTIONS' => array(
'GLOBAL' => array(
'softRefParser' => array(
'substitute' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'notify' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'images' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink_tag' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'ext_fileref' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'email' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'url' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
),
...
),
...
),
'SC_OPTIONS' => [
'GLOBAL' => [
'softRefParser' => [
'substitute' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'notify' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'typolink' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'typolink_tag' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'ext_fileref' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'email' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
'url' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
],
],
// ...
],
.. _soft-references-custom-parsers:
Expand All @@ -187,3 +185,11 @@ The class containing the soft reference parser must have a function
named :code:`findRef`. Please refer to class
:php:`TYPO3\CMS\Core\Database\SoftReferenceIndex`
for API usage and expected return values.

Using the soft reference parser
===============================

To use the soft reference parser in your own extensions, use
:php:`\TYPO3\CMS\Backend\Utility\BackendUtility::softRefParserObj` to get
the parser for a specific soft reference type. For an example, take a look at
:php:`\TYPO3\CMS\Linkvalidator\LinkAnalyzer::analyzeRecord`.

0 comments on commit 166709f

Please sign in to comment.