class ShortCodeRelationFinder (View source)

Finds DataObject instances using certain shortcodes by fulltext-querying only fields which are capable of parsing shortcodes.

Effectively the reverse of "link tracking", which updates this relation on write rather than fetching it on demand.

Doesn't scale to millions of pages due to triggering a potentially unindexed LIKE search across dozens of columns and tables - but for a couple of hundred pages and occasionally use its a feasible solution.

Properties

protected string $fieldSpecRegex

Methods

public
array
findPageIDs($number)

No description

public
findPageCount($number)

No description

public
getList(int $number)

No description

public
array
getShortcodeFields($class)

Returns a filtered list of fields which could contain shortcodes.

Details

array findPageIDs($number)

No description

Parameters

$number

Return Value

array IDs

findPageCount($number)

No description

Parameters

$number

DataList getList(int $number)

No description

Parameters

int $number

Return Value

DataList

array getShortcodeFields($class)

Returns a filtered list of fields which could contain shortcodes.

Parameters

$class

Return Value

array

Map of class names to an array of field names on these classes.