예제 #1
0
파일: ToDoSaga.php 프로젝트: martyn82/apha
 /**
  * @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;
 }
예제 #2
0
파일: ToDoSaga.php 프로젝트: martyn82/apha
 /**
  * @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;
 }
예제 #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);
 }
예제 #4
0
파일: ToDoItem.php 프로젝트: martyn82/apha
 /**
  * @param ToDoItemCreated $event
  */
 public function applyToDoItemCreated(ToDoItemCreated $event)
 {
     $this->id = $event->getIdentity();
 }
예제 #5
0
 /**
  * @param ToDoItemCreated $event
  */
 public function applyToDoItemCreated(ToDoItemCreated $event)
 {
     $this->identity = $event->getIdentity();
     $this->isDone = false;
 }