Beispiel #1
0
 /**
  * @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;
 }
Beispiel #2
0
 /**
  * @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;
 }
Beispiel #3
0
 /**
  * @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);
 }
Beispiel #4
0
 /**
  * @param ToDoItemCreated $event
  */
 public function applyToDoItemCreated(ToDoItemCreated $event)
 {
     $this->id = $event->getIdentity();
 }
Beispiel #5
0
 /**
  * @param ToDoItemCreated $event
  */
 public function applyToDoItemCreated(ToDoItemCreated $event)
 {
     $this->identity = $event->getIdentity();
     $this->isDone = false;
 }