W3cubDocs

/Drupal 8

public function FormState::getCacheableArray

public FormState::getCacheableArray()

Returns an array representation of the cacheable portion of the form state.

Return value

array The cacheable portion of the form state.

Overrides FormStateInterface::getCacheableArray

File

core/lib/Drupal/Core/Form/FormState.php, line 877

Class

FormState
Stores information about the state of a form.

Namespace

Drupal\Core\Form

Code

public function getCacheableArray() {
  return [
    'build_info' => $this->getBuildInfo(),
    'response' => $this->getResponse(),
    'programmed' => $this->isProgrammed(),
    'programmed_bypass_access_check' => $this->isBypassingProgrammedAccessChecks(),
    'process_input' => $this->isProcessingInput(),
    'has_file_element' => $this->hasFileElement(),
    'storage' => $this->getStorage(),
    // Use the properties directly, since self::isCached() combines them and
    // cannot be relied upon.
    'cache' => $this->cache,
    'no_cache' => $this->no_cache,
  ];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormState.php/function/FormState::getCacheableArray/8.1.x