| @@ 54-69 (lines=16) @@ | ||
| 51 | /** |
|
| 52 | * @inheritdoc |
|
| 53 | */ |
|
| 54 | public function applyLabelAdded($labelAdded, Metadata $metadata) |
|
| 55 | { |
|
| 56 | $LabelRelation = $this->createLabelRelation($labelAdded); |
|
| 57 | ||
| 58 | try { |
|
| 59 | if (!is_null($LabelRelation)) { |
|
| 60 | $this->writeRepository->save( |
|
| 61 | $LabelRelation->getLabelName(), |
|
| 62 | $LabelRelation->getRelationType(), |
|
| 63 | $LabelRelation->getRelationId() |
|
| 64 | ); |
|
| 65 | } |
|
| 66 | } catch (UniqueConstraintViolationException $exception) { |
|
| 67 | // By design to catch unique exception. |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * @inheritdoc |
|
| @@ 74-84 (lines=11) @@ | ||
| 71 | /** |
|
| 72 | * @inheritdoc |
|
| 73 | */ |
|
| 74 | public function applyLabelDeleted($labelDeleted, Metadata $metadata) |
|
| 75 | { |
|
| 76 | $labelRelation = $this->createLabelRelation($labelDeleted); |
|
| 77 | ||
| 78 | if (!is_null($labelRelation)) { |
|
| 79 | $this->writeRepository->deleteByLabelNameAndRelationId( |
|
| 80 | $labelRelation->getLabelName(), |
|
| 81 | $labelRelation->getRelationId() |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * @param EventImportedFromUDB2 $eventImportedFromUDB2 |
|