Skip to content

Commit

Permalink
Merge pull request #24 from greblov/volberg-transitions
Browse files Browse the repository at this point in the history
fix set transition ID in builder
  • Loading branch information
makasim authored Jan 23, 2019
2 parents bd05347 + b17a234 commit edb0408
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Builder/TransitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Formapro\Pvm\Transition;
use Formapro\Pvm\Uuid;
use function Makasim\Values\get_value;
use function Makasim\Values\set_object;

class TransitionBuilder
{
Expand All @@ -30,7 +31,14 @@ public function __construct(ProcessBuilder $processBuilder, Transition $transiti

public function setId(string $id): self
{
$oldId = get_value($this->transition, 'id');

if (null !== $oldId) {
set_object($this->processBuilder->getProcess(), 'transitions.'.$oldId, null);
}

$this->transition->setId($id);
set_object($this->processBuilder->getProcess(), 'transitions.'.$id, $this->transition);

return $this;
}
Expand Down

0 comments on commit edb0408

Please sign in to comment.