Example #1
0
 /**
  * @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;
     }
 }
Example #2
0
 /**
  * @Apha\EventHandler()
  * @param ToDoItemDone $event
  */
 public function onToDoItemDone(ToDoItemDone $event)
 {
     $document = $this->stateStorage->find($event->getIdentity()->getValue());
     $document->apply($event);
     $this->stateStorage->upsert($event->getIdentity()->getValue(), $document);
 }