/** * @param ToDoItemDone $event */ public function onToDoItemDone(ToDoItemDone $event) { $token = $this->openItems[$event->getIdentity()->getValue()]['token']; if ($token != null && $this->scheduler != null) { $this->scheduler->cancelSchedule($token); } unset($this->openItems[$event->getIdentity()->getValue()]); if (empty($this->openItems)) { $this->active = false; } }
/** * @EndSaga() * @SagaEventHandler(associationProperty = "identity") * @param ToDoItemDone $event */ public function onToDoItemDone(ToDoItemDone $event) { $this->scheduler->cancelSchedule($this->expireToken); $this->expireToken = null; }