| @@ 25-68 (lines=44) @@ | ||
| 22 | * |
|
| 23 | * @author Bernhard Schussek <[email protected]> |
|
| 24 | */ |
|
| 25 | class DisableBindingUuid implements AtomicOperation |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * @var Uuid |
|
| 29 | */ |
|
| 30 | private $uuid; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @var InstallInfo |
|
| 34 | */ |
|
| 35 | private $installInfo; |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @var bool |
|
| 39 | */ |
|
| 40 | private $wasDisabled = true; |
|
| 41 | ||
| 42 | public function __construct(Uuid $uuid, InstallInfo $installInfo) |
|
| 43 | { |
|
| 44 | $this->uuid = $uuid; |
|
| 45 | $this->installInfo = $installInfo; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * {@inheritdoc} |
|
| 50 | */ |
|
| 51 | public function execute() |
|
| 52 | { |
|
| 53 | if (!$this->installInfo->hasDisabledBindingUuid($this->uuid)) { |
|
| 54 | $this->wasDisabled = false; |
|
| 55 | $this->installInfo->addDisabledBindingUuid($this->uuid); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * {@inheritdoc} |
|
| 61 | */ |
|
| 62 | public function rollback() |
|
| 63 | { |
|
| 64 | if (!$this->wasDisabled) { |
|
| 65 | $this->installInfo->removeDisabledBindingUuid($this->uuid); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 25-68 (lines=44) @@ | ||
| 22 | * |
|
| 23 | * @author Bernhard Schussek <[email protected]> |
|
| 24 | */ |
|
| 25 | class EnableBindingUuid implements AtomicOperation |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * @var Uuid |
|
| 29 | */ |
|
| 30 | private $uuid; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @var InstallInfo |
|
| 34 | */ |
|
| 35 | private $installInfo; |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @var bool |
|
| 39 | */ |
|
| 40 | private $wasDisabled = false; |
|
| 41 | ||
| 42 | public function __construct(Uuid $uuid, InstallInfo $installInfo) |
|
| 43 | { |
|
| 44 | $this->uuid = $uuid; |
|
| 45 | $this->installInfo = $installInfo; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * {@inheritdoc} |
|
| 50 | */ |
|
| 51 | public function execute() |
|
| 52 | { |
|
| 53 | if ($this->installInfo->hasDisabledBindingUuid($this->uuid)) { |
|
| 54 | $this->wasDisabled = true; |
|
| 55 | $this->installInfo->removeDisabledBindingUuid($this->uuid); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * {@inheritdoc} |
|
| 61 | */ |
|
| 62 | public function rollback() |
|
| 63 | { |
|
| 64 | if ($this->wasDisabled) { |
|
| 65 | $this->installInfo->addDisabledBindingUuid($this->uuid); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||