/** * @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; }
/** * @param Map $map */ public function putAll(Map $map) { foreach ($map->entrySet()->getIterator() as $entry) { /* @var $entry Entry */ $this->put($entry->getKey(), $entry->getValue()); } }
/** * @param string $key * @return string */ public function getClassByEventName($key) { return $this->innerMap->get($key); }