| @@ 60-68 (lines=9) @@ | ||
| 57 | * @param SagaInterface $saga The saga to store |
|
| 58 | * @param SerializerInterface $serializer The serialization mechanism to convert the Saga to a byte stream |
|
| 59 | */ |
|
| 60 | public function __construct(SagaInterface $saga, SerializerInterface $serializer) |
|
| 61 | { |
|
| 62 | $this->sagaId = $saga->getSagaIdentifier(); |
|
| 63 | $serialized = $serializer->serialize($saga); |
|
| 64 | $this->serializedSaga = $serialized->getData(); |
|
| 65 | $this->sagaType = get_class($saga); |
|
| 66 | $this->saga = $saga; |
|
| 67 | $this->associationValues = $saga->getAssociationValues()->asArray(); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * Returns the Saga instance stored in this entry. |
|
| @@ 79-89 (lines=11) @@ | ||
| 76 | * @param SagaInterface $saga The saga to store |
|
| 77 | * @param SerializerInterface $serializer The serialization mechanism to convert the Saga to a byte stream |
|
| 78 | */ |
|
| 79 | public function __construct( |
|
| 80 | SagaInterface $saga, |
|
| 81 | SerializerInterface $serializer |
|
| 82 | ) { |
|
| 83 | $this->sagaId = $saga->getSagaIdentifier(); |
|
| 84 | $serialized = $serializer->serialize($saga); |
|
| 85 | $this->serializedSaga = $serialized->getData(); |
|
| 86 | $this->sagaType = $serialized->getType()->getName(); |
|
| 87 | $this->revision = $serialized->getType()->getRevision(); |
|
| 88 | $this->saga = $saga; |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * Returns the Saga instance stored in this entry. |
|