/**
  * @param string $id
  * 
  * @return AggregateRoot
  */
 public function load($id)
 {
     try {
         $this->lockManager->obtain($id);
         return $this->repository->load($id);
     } catch (Exception $e) {
         $this->lockManager->release($id);
     }
 }
 /**
  * @param DeleteLabel $label
  */
 protected function handleDeleteLabel(DeleteLabel $label)
 {
     /** @var Event $event */
     $event = $this->eventRepository->load($label->getItemId());
     $event->deleteLabel($label->getLabel());
     $this->eventRepository->save($event);
 }
 /**
  * @param StringLiteral $entityId
  * @param CdbXmlContainerInterface $cdbXml
  */
 private function update(StringLiteral $entityId, CdbXmlContainerInterface $cdbXml)
 {
     $entityId = (string) $entityId;
     /** @var UpdateableWithCdbXmlInterface|AggregateRoot $entity */
     $entity = $this->repository->load($entityId);
     $entity->updateWithCdbXml($cdbXml->getCdbXml(), $cdbXml->getCdbXmlNamespaceUri());
     $this->repository->save($entity);
 }