From 52b3abb929b4beaecaf4cb358e3e8b78257877fb Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 27 Jan 2017 13:04:43 +0100 Subject: [PATCH] Simulation: load current simulations from session fixes #93 --- library/Businessprocess/Simulation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Businessprocess/Simulation.php b/library/Businessprocess/Simulation.php index 2053811..1bc9d1d 100644 --- a/library/Businessprocess/Simulation.php +++ b/library/Businessprocess/Simulation.php @@ -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; }