Feature #33138

provide getPidList function in ExtBase environment (includes propsed solution)

Added by Jonas Felix over 9 years ago. Updated over 1 year 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

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

Actions
#1

Updated by Alexander Schnitzler over 8 years ago

  • Category set to Extbase: Utility
  • Has patch changed from Yes to No

To be discussed.

#2

Updated by Alexander Schnitzler over 8 years ago

  • Target version set to Extbase 6.2
#3

Updated by Anja Leichsenring about 8 years ago

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

Updated by Alexander Opitz almost 7 years ago

  • Status changed from New to Needs Feedback

Hi,

was this issue fixed or does it still exists?

#5

Updated by Jonas Felix almost 7 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.

#6

Updated by Alexander Opitz over 6 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
#7

Updated by Mathias Schreiber over 6 years ago

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

Updated by Benni Mack about 6 years ago

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

Updated by Susanne Moog almost 6 years ago

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

Updated by Benni Mack almost 6 years ago

  • Target version changed from 7.5 to 8 LTS
#11

Updated by Riccardo De Contardi over 4 years ago

  • Target version changed from 8 LTS to 9.0
#12

Updated by Susanne Moog over 3 years ago

  • Target version deleted (9.0)
#13

Updated by Susanne Moog over 1 year 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.

Also available in: Atom PDF