示例#1
0
 /**
  * @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));
 }
示例#2
0
 /**
  * @param Identity $identity
  */
 public function __construct(Identity $identity = null)
 {
     if ($identity == null) {
         $identity = Identity::createNew();
     }
     $this->setParameterResolver(new DefaultParameterResolver());
     parent::__construct($identity, new AssociationValues([]));
 }
示例#3
0
 /**
  * @param Identity $identity
  * @param AssociationValues $associationValues
  */
 public function __construct(Identity $identity, AssociationValues $associationValues)
 {
     parent::__construct($identity, $associationValues);
     $this->openItems = [];
     $this->active = false;
 }