Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Form/FormCache.php \Drupal\Core\Form\FormCache::__construct()
  2. 9 core/lib/Drupal/Core/Form/FormCache.php \Drupal\Core\Form\FormCache::__construct()

Constructs a new FormCache.

Parameters

string $root: The app root.

\Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface $key_value_expirable_factory: The key value expirable factory, used to create key value expirable stores for the form cache and form state cache.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token: The CSRF token generator.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\PageCache\RequestPolicyInterface $request_policy: A policy rule determining the cacheability of a request.

File

core/lib/Drupal/Core/Form/FormCache.php, line 106

Class

FormCache
Encapsulates the caching of a form and its form state.

Namespace

Drupal\Core\Form

Code

public function __construct($root, KeyValueExpirableFactoryInterface $key_value_expirable_factory, ModuleHandlerInterface $module_handler, AccountInterface $current_user, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, RequestStack $request_stack, RequestPolicyInterface $request_policy) {
  $this->root = $root;
  $this->keyValueExpirableFactory = $key_value_expirable_factory;
  $this->moduleHandler = $module_handler;
  $this->currentUser = $current_user;
  $this->logger = $logger;
  $this->csrfToken = $csrf_token;
  $this->requestStack = $request_stack;
  $this->requestPolicy = $request_policy;
}