Пример #1
0
 /**
  * @param Uuid $aggregateId
  * @param integer $playHead
  * @return boolean
  */
 private function isValidPlayHead(Uuid $aggregateId, $playHead)
 {
     $eventDescriptors = $this->storage->find($aggregateId->getValue());
     if (!empty($eventDescriptors)) {
         $this->current->put($aggregateId->getValue(), end($eventDescriptors)->getPlayhead());
     }
     if ($this->current->get($aggregateId->getValue()) != $playHead && $playHead != -1) {
         return false;
     }
     return true;
 }
Пример #2
0
 /**
  * @param string $eventClass
  */
 private function add($eventClass)
 {
     $this->innerMap->put($eventClass::getName(), $eventClass);
 }