[BUGFIX] Adjust Headline of documentation file
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 7.5 / Feature-52217-SignalForPreProcessingLinkvalidatorRecords.rst
1
2 .. include:: ../../Includes.txt
3
4 =================================================================
5 Feature: #52217 - Signal for pre processing linkvalidator records
6 =================================================================
7
8 See :issue:`52217`
9
10 Description
11 ===========
12
13 This signal allows for additional processing upon initialization of a specific record,
14 e.g. getting content data from plugin configuration in record.
15
16 Registering the signal: (in ext_localconf.php)
17
18 .. code-block:: php
19
20 $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
21 $signalSlotDispatcher->connect(
22 \TYPO3\CMS\Linkvalidator\LinkAnalyzer::class,
23 'beforeAnalyzeRecord',
24 \Vendor\Package\Slots\RecordAnalyzerSlot::class,
25 'beforeAnalyzeRecord'
26 );
27
28 ..
29
30 The slot class:
31
32 .. code-block:: php
33
34 namespace Vendor\Package\Slots;
35
36 use TYPO3\CMS\Linkvalidator\LinkAnalyzer;
37
38 class RecordAnalyzerSlot {
39
40 /**
41 * Receives a signal before the record is analyzed
42 *
43 * @param array $results Array of broken links
44 * @param array $record Record to analyse
45 * @param string $table Table name of the record
46 * @param array $fields Array of fields to analyze
47 * @param LinkAnalyzer $parentObject Parent object
48 * @return array
49 */
50 public function beforeAnalyzeRecord($results, $record, $table, $fields, LinkAnalyzer $parentObject) {
51 // Processing here
52 return array(
53 $results,
54 $record
55 );
56 }
57 }
58
59 ..
60
61 Impact
62 ======
63
64 Extensions may now perform any kind of processing for every record when validating content links.
65
66
67 .. index:: PHP-API, Backend, ext:linkvalidator