/** * @param Saga $saga * @return void */ public function commit(Saga $saga) { if (!$saga->isActive()) { $this->storage->delete($saga->getId()->getValue()); return; } $associationValues = $this->associationValuesToArray($saga->getAssociationValues()); $this->storage->update(get_class($saga), $saga->getId()->getValue(), $associationValues, $this->serializer->serialize($saga)); }
/** * @param Identity $identity */ public function __construct(Identity $identity = null) { if ($identity == null) { $identity = Identity::createNew(); } $this->setParameterResolver(new DefaultParameterResolver()); parent::__construct($identity, new AssociationValues([])); }
/** * @param Identity $identity * @param AssociationValues $associationValues */ public function __construct(Identity $identity, AssociationValues $associationValues) { parent::__construct($identity, $associationValues); $this->openItems = []; $this->active = false; }