Example #1
0
 /**
  * {@inheritdoc}
  */
 public function delete($id)
 {
     $tokens = $this->session->get('_tokens', array());
     if (array_key_exists($id, $tokens)) {
         unset($tokens[$id]);
     }
     $this->session->set('_tokens', $tokens);
 }
Example #2
0
 /**
  * Set the data for the field definitions contained by this form data container from session variables.
  *
  * The session variables should be named the same as the field names. Session variables within the namespace that
  * do not represent known fields are ignored. The validation status of the form data container is reset by this function.
  *
  * @param \Zikula_Session $session   The session instance.
  * @param string         $namespace The session namespace where the fields are found; optional; defaults to '/'.
  *
  * @return void
  */
 public function setFromSession(\Zikula_Session $session, $namespace = '/')
 {
     foreach ($this->formFields as $fieldName => $formField) {
         if ($session->has($fieldName, $namespace)) {
             $this->formFields[$fieldName]->setData($session->get($fieldName, null, $namespace));
         }
     }
     $this->clearValidation();
 }