FormCacheInterface.php 961 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Drupal\Core\Form;
  3. /**
  4. * Provides an interface for the caching of a form and its form state.
  5. */
  6. interface FormCacheInterface {
  7. /**
  8. * Fetches a form from the cache.
  9. *
  10. * @param string $form_build_id
  11. * The unique form build ID.
  12. * @param \Drupal\Core\Form\FormStateInterface $form_state
  13. * The current state of the form.
  14. */
  15. public function getCache($form_build_id, FormStateInterface $form_state);
  16. /**
  17. * Stores a form in the cache.
  18. *
  19. * @param string $form_build_id
  20. * The unique form build ID.
  21. * @param array $form
  22. * The form to cache.
  23. * @param \Drupal\Core\Form\FormStateInterface $form_state
  24. * The current state of the form.
  25. */
  26. public function setCache($form_build_id, $form, FormStateInterface $form_state);
  27. /**
  28. * Deletes a form in the cache.
  29. *
  30. * @param string $form_build_id
  31. * The unique form build ID.
  32. */
  33. public function deleteCache($form_build_id);
  34. }