You are here

public function SubrequestsTree::allIds in Subrequests 8.2

Same name and namespace in other branches
  1. 3.x src/SubrequestsTree.php \Drupal\subrequests\SubrequestsTree::allIds()

Gets all the subrequest IDs.

Return value

\Drupal\subrequests\Subrequest[] All the subrequests in all levels.

File

src/SubrequestsTree.php, line 76

Class

SubrequestsTree
Value class that holds the execution tree.

Namespace

Drupal\subrequests

Code

public function allIds() {
  $subrequests = [];
  foreach ($this as $item) {
    $subrequests = array_merge($subrequests, array_values($item));
  }
  $all_request_ids = array_map(function (Subrequest $subrequest) {
    return $subrequest->requestId;
  }, $subrequests);
  array_unshift($all_request_ids, '<ROOT>');
  return array_unique($all_request_ids);
}