CategoryMenuUtility

Utility class for menus based on category collections of pages.

Returns all the relevant pages for rendering with a menu content object.

Internal

this is only used for internal purposes and solely used for EXT:frontend and not part of TYPO3's Core API.

Table of Contents

Properties

$sortingField  : string

Methods

collectPages()  : array<string|int, mixed>
Collects all pages for the selected categories, sorted according to configuration.
sortPagesUtility()  : int
Static utility for sorting pages according to the selected criterion
sortPages()  : array<string|int, mixed>
Sorts the selected pages

Properties

$sortingField

protected static string $sortingField

Name of the field used for sorting the pages

Methods

collectPages()

Collects all pages for the selected categories, sorted according to configuration.

public collectPages(string $selectedCategories, array<string|int, mixed>|null $configuration, AbstractMenuContentObject $parentObject) : array<string|int, mixed>
Parameters
$selectedCategories : string

Comma-separated list of system categories primary keys

$configuration : array<string|int, mixed>|null

TypoScript configuration for the "special." keyword

$parentObject : AbstractMenuContentObject

Back-reference to the calling object

Return values
array<string|int, mixed>

List of selected pages

sortPagesUtility()

Static utility for sorting pages according to the selected criterion

public static sortPagesUtility(array<string|int, mixed> $pageA, array<string|int, mixed> $pageB) : int
Parameters
$pageA : array<string|int, mixed>

Record for first page to be compared

$pageB : array<string|int, mixed>

Record for second page to be compared

Return values
int

-1 if first argument is smaller than second argument, 1 if first is greater than second and 0 if both are equal

sortPages()

Sorts the selected pages

protected sortPages(array<string|int, mixed> $pages, string $order) : array<string|int, mixed>

If the sorting field is not defined or does not corresponding to an existing field of the "pages" tables, the list of pages will remain unchanged.

Parameters
$pages : array<string|int, mixed>

List of selected pages

$order : string

Order for sorting (should "asc" or "desc")

Return values
array<string|int, mixed>

Sorted list of pages


        
On this page

Search results