TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CategoryMenuUtility Class Reference

Public Member Functions

 collectPages ($selectedCategories, $configuration, $parentObject)
 

Static Public Member Functions

static sortPagesUtility ($pageA, $pageB)
 

Protected Member Functions

 sortPages ($pages, $order)
 

Static Protected Attributes

static $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.

Definition at line 26 of file CategoryMenuUtility.php.

Member Function Documentation

collectPages (   $selectedCategories,
  $configuration,
  $parentObject 
)

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

Parameters
string$selectedCategoriesComma-separated list of system categories primary keys
array$configurationTypoScript configuration for the "special." keyword
\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject$parentObjectBack-reference to the calling object
Returns
string List of selected pages

Definition at line 41 of file CategoryMenuUtility.php.

References GeneralUtility\intExplode(), CategoryCollection\load(), and CategoryMenuUtility\sortPages().

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

Definition at line 105 of file CategoryMenuUtility.php.

Referenced by CategoryMenuUtility\collectPages().

static sortPagesUtility (   $pageA,
  $pageB 
)
static

Static utility for sorting pages according to the selected criterion

Parameters
array$pageARecord for first page to be compared
array$pageBRecord for second page to be compared
Returns
array -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 142 of file CategoryMenuUtility.php.

Member Data Documentation

$sortingField
staticprotected

Definition at line 31 of file CategoryMenuUtility.php.