Project

General

Profile

Actions

Feature #33138

closed

provide getPidList function in ExtBase environment (includes propsed solution)

Added by Jonas Felix over 12 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2012-01-12
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The storagePid works great, but there are some other cases you need a list of pids and that function is not available for extbase, because it's within tslib_piBase. We have a version that you can use within your controller.

Where should such a function be places? Is there some core lib instead of tslib_piBase?

getPidList($pid_list, $recursive = 0) {
    if (!strcmp($pid_list, '')) {
        $pid_list = $GLOBALS['TSFE']->id;
    }

    $recursive = t3lib_div::intInRange($recursive, 0);

    $pid_list_arr = array_unique(t3lib_div::trimExplode(',', $pid_list, 1));
    $pid_list     = array();

    $tree = t3lib_div::makeInstance('t3lib_queryGenerator');

    foreach($pid_list_arr as $val) {
        $val = t3lib_div::intInRange($val, 0);
            if ($val) {
            $_list = $tree->getTreeList(-1 * $val, $recursive);
            if ($_list) {
                $pid_list[] = $_list;
            }
        }
    }
    return implode(',', $pid_list);
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #70903: Refactor "getTreeList" functions / add utility functionClosed2015-10-21

Actions
Actions #1

Updated by Alexander Schnitzler over 11 years ago

  • Category set to Extbase: Utility

To be discussed.

Actions #2

Updated by Alexander Schnitzler about 11 years ago

  • Target version set to Extbase 6.2
Actions #3

Updated by Anja Leichsenring almost 11 years ago

  • Target version changed from Extbase 6.2 to Extbase 6.3
Actions #4

Updated by Alexander Opitz over 9 years ago

  • Status changed from New to Needs Feedback

Hi,

was this issue fixed or does it still exists?

Actions #5

Updated by Jonas Felix over 9 years ago

I don't think there is a function within the ExtBase Scope.
But of course the function is still needed. It's only that everybody does his own version in his/her extension.

Actions #6

Updated by Alexander Opitz over 9 years ago

  • Project changed from 534 to TYPO3 Core
  • Category changed from Extbase: Utility to Extbase
  • Status changed from Needs Feedback to New
  • Target version changed from Extbase 6.3 to 7.0
Actions #7

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #8

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #9

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #10

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 8 LTS
Actions #11

Updated by Riccardo De Contardi about 7 years ago

  • Target version changed from 8 LTS to 9.0
Actions #12

Updated by Susanne Moog about 6 years ago

  • Target version deleted (9.0)
Actions #13

Updated by Susanne Moog about 4 years ago

  • Status changed from New to Closed

Nowadays the method doesn't provide much convenience, for queries you'd rather have an array and there are few cases where you'd need to fetch multiple trees at ones. For fetching the pids of a single tree there is cObj->getTreeList already.

Closing this issue now.

Actions

Also available in: Atom PDF