You are here

public function SubrequestsTree::stack in Subrequests 8.2

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

Adds a sequence of subrequests to the stack.

Parameters

\Drupal\subrequests\Subrequest[] $subrequests:

File

src/SubrequestsTree.php, line 24

Class

SubrequestsTree
Value class that holds the execution tree.

Namespace

Drupal\subrequests

Code

public function stack($subrequests) {

  // Make sure we only push Subrequest objects.
  $this
    ->append(array_filter($subrequests, function ($subrequest) {
    return $subrequest instanceof Subrequest;
  }));
}