You are here

class FormState in Module Builder 7.2

Wrapper around D7's form state array, so D8 methods work.

Hierarchy

Expanded class hierarchy of FormState

File

includes/module_builder.pages.inc, line 433
Menu callback for main module builder page.

View source
class FormState implements FormStateInterface {
  function __construct(&$form_state_array) {
    $this->form_state =& $form_state_array;

    // Initialize storage as an empty array so NestedArray works.
    if (!isset($this->form_state['storage'])) {
      $this->form_state['storage'] = [];
    }
  }
  public function set($address, $value) {
    NestedArray::setValue($this->form_state['storage'], $address, $value);

    // dsm($this->form_state['storage']);
  }
  public function get($address) {
    return NestedArray::getValue($this->form_state['storage'], $address);
  }
  public function getValues() {
    return $this->form_state['values'];
  }
  public function setRebuild() {
    $this->form_state['rebuild'] = TRUE;
  }
  public function getTriggeringElement() {
    return $this->form_state['triggering_element'];
  }

}

Members