Project

General

Profile

Actions

Bug #64257

closed

PageRepository::getMenu(): Support multiple uid

Added by Christian Weiske almost 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2015-01-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

TYPO3\CMS\Frontend\Page\PageRepository::getMenu() currently only supports an integer as $uid parameter, allowing selecting the subpages of a single parent page only.

When building a menu myself, I want to do this as efficient as possible. This means that I'd like to select the pages on the second level with a single query, instead of querying each child page for their pages.

Having getMenu() support an array of UIDs would solve the problem and make efficient selection of second level child pages possible.

Current unwanted state:

//number of SQL queries increases with the number of menu items
$childPages = $pageSelect->getMenu(0);
$subChildPages = array();
foreach ($pages as $page) {
    $subChildPages = array_merge(
        $subChildPages,
        $pageSelect->getMenu($page['uid'])
    );
}

Wanted:

// only 2 SQL queries, no matter how many child pages exist
$childPages = $pageSelect->getMenu(0);
$childUids = array_keys($childPages);
$subChildPages = $pageSelect->getMenu($childUids);


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #64258: PageRepository::getPageOverlay() for multiple pages at onceClosed2015-01-13

Actions
Actions

Also available in: Atom PDF