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

Public Member Functions

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

Protected Attributes

const TABLE = 'tx_linkvalidator_link'
 

Detailed Description

Repository for finding broken links that were detected previously.

Definition at line 31 of file BrokenLinkRepository.php.

Member Function Documentation

◆ addBrokenLink()

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

Add broken link to table tx_linkvalidator_link

Parameters
array$record
bool$isValid
array$errorParams
Exceptions

Definition at line 333 of file BrokenLinkRepository.php.

References TYPO3\CMS\Webhooks\Message\$record.

◆ getAllBrokenLinksForPages()

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

Definition at line 235 of file BrokenLinkRepository.php.

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

◆ getNumberOfBrokenLinksForRecordsOnPages()

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, ...], ...]

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 42 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 33 of file BrokenLinkRepository.php.