BrokenLinkRepository
class \
Repository for finding broken links that were detected previously.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Constants
- TABLE : mixed = 'tx_linkvalidator_link'
Methods
- addBrokenLink() : void
- Add broken link to table tx_linkvalidator_link
- getAllBrokenLinksForPages() : array
- Prepare database query with pageList and keyOpt data.
- getNumberOfBrokenLinksForRecordsOnPages() : array
- 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 $record, bool $isValid[, array $errorParams = [] ]) : void
Parameters
- $record : array
- $isValid : bool
- $errorParams : array = []
Tags
getAllBrokenLinksForPages()
Prepare database query with pageList and keyOpt data.
public
getAllBrokenLinksForPages(int[] $pageIds, string[] $linkTypes[, string[][] $searchFields = [] ][, int[] $languages = [] ]) : array
This takes permissions of current BE user into account
Parameters
- $pageIds : int[]
-
Pages to check for broken links
- $linkTypes : string[]
-
Link types to validate
- $searchFields : string[][] = []
-
table => [fields1, field2, ...], ... : fields in which linkvalidator should search for broken links
- $languages : int[] = []
-
Allowed languages
Return values
arraygetNumberOfBrokenLinksForRecordsOnPages()
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(int[] $pageIds, array $searchFields) : array
Parameters
- $pageIds : int[]
- $searchFields : array
-
[ table => [field1, field2, ...], ...]
Return values
arrayisLinkTargetBrokenLink()
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(int[] $pageIds, array<int, string> $linkTypes) : void
Parameters
- $pageIds : 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