BrokenLinkRepository
Repository for finding broken links that were detected previously.
Table of Contents
Constants
- TABLE = 'tx_linkvalidator_link'
Methods
- addBrokenLink() : void
- Add broken link to table tx_linkvalidator_link
- getAllBrokenLinksForPages() : array<string|int, mixed>
- Prepare database query with pageList and keyOpt data.
- getNumberOfBrokenLinksForRecordsOnPages() : array<string|int, mixed>
- Returns all broken links found on the page record and all records on a page (or multiple pages) grouped by the link_type.
- isLinkTargetBrokenLink() : bool
- Check if linkTarget is in list of broken links.
- removeAllBrokenLinksOfRecordsOnPageIds() : void
- removeBrokenLinksForRecord() : void
- setNeedsRecheckForRecord() : void
Constants
TABLE
protected
mixed
TABLE
= 'tx_linkvalidator_link'
Methods
addBrokenLink()
Add broken link to table tx_linkvalidator_link
public
addBrokenLink(array<string|int, mixed> $record, bool $isValid[, array<string|int, mixed>|null $errorParams = null ]) : void
Parameters
- $record : array<string|int, mixed>
- $isValid : bool
- $errorParams : array<string|int, mixed>|null = null
Tags
getAllBrokenLinksForPages()
Prepare database query with pageList and keyOpt data.
public
getAllBrokenLinksForPages(array<string|int, int> $pageIds, array<string|int, string> $linkTypes[, array<string|int, string> $searchFields = [] ][, array<string|int, int> $languages = [] ]) : array<string|int, mixed>
This takes permissions of current BE user into account
Parameters
- $pageIds : array<string|int, int>
-
Pages to check for broken links
- $linkTypes : array<string|int, string>
-
Link types to validate
- $searchFields : array<string|int, string> = []
-
table => [fields1, field2, ...], ... : fields in which linkvalidator should search for broken links
- $languages : array<string|int, int> = []
-
Allowed languages
Return values
array<string|int, mixed>getNumberOfBrokenLinksForRecordsOnPages()
Returns all broken links found on the page record and all records on a page (or multiple pages) grouped by the link_type.
public
getNumberOfBrokenLinksForRecordsOnPages(array<string|int, int> $pageIds, array<string|int, mixed> $searchFields) : array<string|int, mixed>
Parameters
- $pageIds : array<string|int, int>
- $searchFields : array<string|int, mixed>
-
[ table => [field1, field2, ...], ...]
Return values
array<string|int, mixed>isLinkTargetBrokenLink()
Check if linkTarget is in list of broken links.
public
isLinkTargetBrokenLink(string $linkTarget[, string $linkType = '' ]) : bool
Parameters
- $linkTarget : string
-
Url to check for. Can be a URL (for external links) a page uid (for db links), a file reference (for file links), etc.
- $linkType : string = ''
Return values
bool —is the link target a broken link
removeAllBrokenLinksOfRecordsOnPageIds()
public
removeAllBrokenLinksOfRecordsOnPageIds(array<string|int, int> $pageIds, array<int, string> $linkTypes) : void
Parameters
- $pageIds : array<string|int, int>
- $linkTypes : array<int, string>
removeBrokenLinksForRecord()
public
removeBrokenLinksForRecord(string $tableName, int $recordUid) : void
Parameters
- $tableName : string
- $recordUid : int
setNeedsRecheckForRecord()
public
setNeedsRecheckForRecord(int $recordUid, string $tableName) : void
Parameters
- $recordUid : int
- $tableName : string