class SiteTreeLinkTracking_Parser (View source)

A helper object for extracting information about links.

Methods

public
array
process(SS_HTMLValue $htmlValue)

Finds the links that are of interest for the link tracking automation. Checks for brokenness and attaches extracted metadata so consumers can decide what to do with the DOM element (provided as DOMReference).

Details

array process(SS_HTMLValue $htmlValue)

Finds the links that are of interest for the link tracking automation. Checks for brokenness and attaches extracted metadata so consumers can decide what to do with the DOM element (provided as DOMReference).

Parameters

SS_HTMLValue $htmlValue

Object to parse the links from.

Return Value

array

Associative array containing found links with the following field layout: Type: string, name of the link type Target: any, a reference to the target object, depends on the Type Anchor: string, anchor part of the link DOMReference: DOMElement, reference to the link to apply changes. Broken: boolean, a flag highlighting whether the link should be treated as broken.