‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility Class Reference

Public Member Functions

array collectPages ($selectedCategories, $configuration, $parentObject)
 

Static Public Member Functions

static int sortPagesUtility ($pageA, $pageB)
 

Protected Member Functions

array sortPages ($pages, $order)
 

Static Protected Attributes

static string $sortingField
 

Detailed Description

Utility class for menus based on category collections of pages.

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

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

Definition at line 28 of file CategoryMenuUtility.php.

Member Function Documentation

◆ collectPages()

array TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility::collectPages (   $selectedCategories,
  $configuration,
  $parentObject 
)

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

Parameters
string$selectedCategories‪Comma-separated list of system categories primary keys
array | null$configuration‪TypoScript configuration for the "special." keyword
\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject$parentObject‪Back-reference to the calling object
Returns
‪array List of selected pages

Definition at line 42 of file CategoryMenuUtility.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Frontend\Category\Collection\CategoryCollection\load(), and TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility\sortPages().

◆ sortPages()

array TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility::sortPages (   $pages,
  $order 
)
protected

Sorts the selected pages

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
array$pages‪List of selected pages
string$order‪Order for sorting (should "asc" or "desc")
Returns
‪array Sorted list of pages

Definition at line 98 of file CategoryMenuUtility.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility\collectPages().

◆ sortPagesUtility()

static int TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility::sortPagesUtility (   $pageA,
  $pageB 
)
static

Static utility for sorting pages according to the selected criterion

Parameters
array$pageA‪Record for first page to be compared
array$pageB‪Record for second page to be compared
Returns
‪int -1 if first argument is smaller than second argument, 1 if first is greater than second and 0 if both are equal

Definition at line 135 of file CategoryMenuUtility.php.

Member Data Documentation

◆ $sortingField

string TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility::$sortingField
staticprotected

Name of the field used for sorting the pages

Definition at line 32 of file CategoryMenuUtility.php.