You are here

public function RequestStack::getParentRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/RequestStack.php \Symfony\Component\HttpFoundation\RequestStack::getParentRequest()

Returns the parent request of the current.

Be warned that making your code aware of the parent request might make it un-compatible with other features of your framework like ESI support.

If current Request is the master request, it returns null.

Return value

Request|null

File

vendor/symfony/http-foundation/RequestStack.php, line 93

Class

RequestStack
Request stack that controls the lifecycle of requests.

Namespace

Symfony\Component\HttpFoundation

Code

public function getParentRequest() {
  $pos = count($this->requests) - 2;
  if (!isset($this->requests[$pos])) {
    return;
  }
  return $this->requests[$pos];
}