/** * @param ToDoItemCreated $event */ public function onToDoItemCreated(ToDoItemCreated $event) { if ($this->scheduler != null) { $token = $this->scheduler->scheduleAfter(new \DateInterval("PT{$event->getExpireSeconds()}S"), new DeadlineExpired($event->getIdentity())); } else { $token = null; } $this->openItems[$event->getIdentity()->getValue()] = ['description' => $event->getDescription(), 'token' => $token]; $this->active = true; }
/** * @StartSaga() * @SagaEventHandler(associationProperty = "identity") * @param ToDoItemCreated $event */ public function onToDoItemCreated(ToDoItemCreated $event) { $token = $this->scheduler->scheduleAfter(new \DateInterval("PT{$event->getExpireSeconds()}S"), new DeadlineExpired($event->getIdentity())); $this->expireToken = $token; }
/** * @Apha\EventHandler() * @param ToDoItemCreated $event */ public function onToDoItemCreated(ToDoItemCreated $event) { $document = new ToDoItemDocument($event->getIdentity()->getValue(), $event->getVersion()); $this->stateStorage->upsert($event->getIdentity()->getValue(), $document); }
/** * @param ToDoItemCreated $event */ public function applyToDoItemCreated(ToDoItemCreated $event) { $this->id = $event->getIdentity(); }
/** * @param ToDoItemCreated $event */ public function applyToDoItemCreated(ToDoItemCreated $event) { $this->identity = $event->getIdentity(); $this->isDone = false; }