/** * * @param \Nethgui\Utility\SessionInterface $session * @param string $path * @param string $ruleId * @return \NethServer\Module\FirewallRules\RuleWorkflow */ public function start(\Nethgui\Utility\SessionInterface $session, $startId, $path, $ruleId, $defaults = array()) { $session->store(self::SESSION_KEY, $this->state); $this->state->exchangeArray($defaults); $this->state['ruleId'] = $ruleId; $this->state['startId'] = $startId; $this->state['backPath'] = $path; return $this; }
private function retrieveFromSession() { $state = $this->session->retrieve(__CLASS__); if ($state instanceof \ArrayObject) { $this->state = $state; } else { // TODO: try to resume the session stored in old format: $u = $this->session->retrieve(\Nethgui\Authorization\UserInterface::ID); if ($u instanceof self) { $this->state = $u->state; $this->session->store(__CLASS__, $this->state); } else { $this->session->login()->store(__CLASS__, $this->state); } } $this->modified = FALSE; }
public function setSession(\Nethgui\Utility\SessionInterface $session) { /* @var $data \ArrayObject */ $data = $session->retrieve(__CLASS__); if ($data !== NULL) { /* @var $data \ArrayObject */ $this->data->exchangeArray(array_replace_recursive($data->getArrayCopy(), $this->data->getArrayCopy())); } $session->store(__CLASS__, $this->data); return $this; }