|
@@ 536-544 (lines=9) @@
|
| 533 |
|
$this->workflowStatus = WorkflowStatus::REJECTED(); |
| 534 |
|
} |
| 535 |
|
|
| 536 |
|
protected function applyImageAdded(AbstractImageAdded $imageAdded) |
| 537 |
|
{ |
| 538 |
|
$imageId = $imageAdded->getImage()->getMediaObjectId(); |
| 539 |
|
$this->mediaObjects[] = $imageId; |
| 540 |
|
|
| 541 |
|
if (count($this->mediaObjects) === 1) { |
| 542 |
|
$this->mainImageId = $imageId; |
| 543 |
|
} |
| 544 |
|
} |
| 545 |
|
|
| 546 |
|
protected function applyImageRemoved(AbstractImageRemoved $imageRemoved) |
| 547 |
|
{ |
|
@@ 546-557 (lines=12) @@
|
| 543 |
|
} |
| 544 |
|
} |
| 545 |
|
|
| 546 |
|
protected function applyImageRemoved(AbstractImageRemoved $imageRemoved) |
| 547 |
|
{ |
| 548 |
|
$this->mediaObjects = array_diff( |
| 549 |
|
$this->mediaObjects, |
| 550 |
|
[$imageRemoved->getImage()->getMediaObjectId()] |
| 551 |
|
); |
| 552 |
|
|
| 553 |
|
$oldestImageId = reset($this->mediaObjects); |
| 554 |
|
if ($oldestImageId) { |
| 555 |
|
$this->mainImageId = $oldestImageId; |
| 556 |
|
} |
| 557 |
|
} |
| 558 |
|
|
| 559 |
|
protected function applyMainImageSelected(AbstractMainImageSelected $mainImageSelected) |
| 560 |
|
{ |