FormCacheInterface.php 961 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<?php

namespace Drupal\Core\Form;

/**
 * Provides an interface for the caching of a form and its form state.
 */
interface FormCacheInterface {

  /**
   * Fetches a form from the cache.
   *
   * @param string $form_build_id
   *   The unique form build ID.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public function getCache($form_build_id, FormStateInterface $form_state);

  /**
   * Stores a form in the cache.
   *
   * @param string $form_build_id
   *   The unique form build ID.
   * @param array $form
   *   The form to cache.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public function setCache($form_build_id, $form, FormStateInterface $form_state);

32 33 34 35 36 37 38 39
  /**
   * Deletes a form in the cache.
   *
   * @param string $form_build_id
   *   The unique form build ID.
   */
  public function deleteCache($form_build_id);

40
}