Simulation: load current simulations from session

fixes #93
This commit is contained in:
Thomas Gelf 2017-01-27 13:04:43 +01:00
parent 251798ef3a
commit 52b3abb929

View file

@ -50,8 +50,8 @@ class Simulation
public static function fromSession(SessionNamespace $session, $sessionKey = null)
{
return static::create()
->persistToSession($session)
->setSessionKey($sessionKey);
->setSessionKey($sessionKey)
->persistToSession($session);
}
/**
@ -76,6 +76,7 @@ class Simulation
public function persistToSession(SessionNamespace $session)
{
$this->session = $session;
$this->simulations = $this->session->get($this->sessionKey, array());
return $this;
}