You are here

public function SessionTestController::setSessionBagFlag in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::setSessionBagFlag()
  2. 9 core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::setSessionBagFlag()

Sets the test flag in the session test bag.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

\Symfony\Component\HttpFoundation\Response The response object.

1 string reference to 'SessionTestController::setSessionBagFlag'
session_test.routing.yml in core/modules/system/tests/modules/session_test/session_test.routing.yml
core/modules/system/tests/modules/session_test/session_test.routing.yml

File

core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php, line 208

Class

SessionTestController
Controller providing page callbacks for the action admin interface.

Namespace

Drupal\session_test\Controller

Code

public function setSessionBagFlag(Request $request) {

  /** @var \Drupal\session_test\Session\TestSessionBag */
  $bag = $request
    ->getSession()
    ->getBag(TestSessionBag::BAG_NAME);
  $bag
    ->setFlag();
  return new Response();
}