|
@@ 57-69 (lines=13) @@
|
| 54 |
|
} |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
protected function doDelete(AggregateRootInterface $object) |
| 58 |
|
{ |
| 59 |
|
if (null !== $object->getVersion() && !$this->lockManager->validateLock($object)) { |
| 60 |
|
throw new ConcurrencyException(sprintf( |
| 61 |
|
"The aggregate of type [%s] with identifier [%s] could not be " . |
| 62 |
|
"saved, as a valid lock is not held. Either another thread has saved an aggregate, or " . |
| 63 |
|
"the current thread had released its lock earlier on.", |
| 64 |
|
get_class($object), $object->getIdentifier() |
| 65 |
|
)); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
$this->doDeleteWithLock($object); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
protected function doSave(AggregateRootInterface $object) |
| 72 |
|
{ |
|
@@ 71-83 (lines=13) @@
|
| 68 |
|
$this->doDeleteWithLock($object); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
protected function doSave(AggregateRootInterface $object) |
| 72 |
|
{ |
| 73 |
|
if (null !== $object->getVersion() && !$this->lockManager->validateLock($object)) { |
| 74 |
|
throw new ConcurrencyException(sprintf( |
| 75 |
|
"The aggregate of type [%s] with identifier [%s] could not be " |
| 76 |
|
. "saved, as a valid lock is not held. Either another thread has saved an aggregate, or " |
| 77 |
|
. "the current thread had released its lock earlier on.", |
| 78 |
|
get_class($object), $object->getIdentifier() |
| 79 |
|
)); |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
$this->doSaveWithLock($object); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
/** |
| 86 |
|
* Perform the actual saving of the aggregate. All necessary locks have been verified. |