‪TYPO3CMS  11.5
TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository Class Reference

Public Member Functions

bool isLinkTargetBrokenLink (string $linkTarget, string $linkType='')
 
array getNumberOfBrokenLinksForRecordsOnPages (array $pageIds, array $searchFields)
 
 setNeedsRecheckForRecord (int $recordUid, string $tableName)
 
 removeBrokenLinksForRecord (string $tableName, int $recordUid)
 
 removeAllBrokenLinksOfRecordsOnPageIds (array $pageIds, array $linkTypes)
 
array getAllBrokenLinksForPages (array $pageIds, array $linkTypes, array $searchFields=[], array $languages=[])
 
 addBrokenLink ($record, bool $isValid, ?array $errorParams=null)
 

Protected Attributes

const TABLE = 'tx_linkvalidator_link'
 

Detailed Description

Repository for finding broken links that were detected previously.

Definition at line 30 of file BrokenLinkRepository.php.

Member Function Documentation

◆ addBrokenLink()

TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::addBrokenLink (   $record,
bool  $isValid,
?array  $errorParams = null 
)

Add broken link to table tx_linkvalidator_link

Parameters
array$record
bool$isValid
array | null$errorParams
Exceptions

Definition at line 330 of file BrokenLinkRepository.php.

◆ getAllBrokenLinksForPages()

array TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::getAllBrokenLinksForPages ( array  $pageIds,
array  $linkTypes,
array  $searchFields = [],
array  $languages = [] 
)

Prepare database query with pageList and keyOpt data.

This takes permissions of current BE user into account

Parameters
int[]$pageIds‪Pages to check for broken links
string[]$linkTypes‪Link types to validate
string[]$searchFields‪table => [fields1, field2, ...], ... : fields in which linkvalidator should search for broken links
int[]$languages‪Allowed languages
Returns
‪array

Definition at line 236 of file BrokenLinkRepository.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\Platform\PlatformInformation\getMaxBindParameters().

◆ getNumberOfBrokenLinksForRecordsOnPages()

array TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::getNumberOfBrokenLinksForRecordsOnPages ( array  $pageIds,
array  $searchFields 
)

Returns all broken links found on the page record and all records on a page (or multiple pages) grouped by the link_type.

Parameters
int[]$pageIds
array$searchFields‪[ table => [field1, field2, ...], ...]
Returns
‪array

Definition at line 74 of file BrokenLinkRepository.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\Platform\PlatformInformation\getMaxBindParameters().

◆ isLinkTargetBrokenLink()

bool TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::isLinkTargetBrokenLink ( string  $linkTarget,
string  $linkType = '' 
)

Check if linkTarget is in list of broken links.

Parameters
string$linkTarget‪Url to check for. Can be a URL (for external links) a page uid (for db links), a file reference (for file links), etc.
Returns
‪bool is the link target a broken link

Definition at line 41 of file BrokenLinkRepository.php.

◆ removeAllBrokenLinksOfRecordsOnPageIds()

TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::removeAllBrokenLinksOfRecordsOnPageIds ( array  $pageIds,
array  $linkTypes 
)
Parameters
int[]$pageIds
array<int,string>‪$linkTypes

Definition at line 180 of file BrokenLinkRepository.php.

References TYPO3\CMS\Core\Database\Platform\PlatformInformation\getMaxBindParameters().

◆ removeBrokenLinksForRecord()

TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::removeBrokenLinksForRecord ( string  $tableName,
int  $recordUid 
)

◆ setNeedsRecheckForRecord()

TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::setNeedsRecheckForRecord ( int  $recordUid,
string  $tableName 
)

Member Data Documentation

◆ TABLE

const TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository::TABLE = 'tx_linkvalidator_link'
protected

Definition at line 32 of file BrokenLinkRepository.php.