StagingDatabaseDtoTrait.php
1 year ago
StagingNetworkDtoTrait.php
2 months ago
StagingOperationDtoTrait.php
2 weeks ago
StagingSiteGetterTrait.php
2 months ago
WithAdvanceStagingOptions.php
5 months ago
WithDataAdjustmentTasks.php
9 months ago
WithStagingDatabase.php
2 months ago
WithStagingEnginePreference.php
2 weeks ago
WithStagingRequirementLogs.php
2 weeks ago
WithStagingSiteDto.php
1 year ago
WithStagingEnginePreference.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Staging\Traits; |
| 4 | |
| 5 | use WPStaging\Staging\Service\StagingEngine; |
| 6 | |
| 7 | /** |
| 8 | * Persists the staging engine selected for the current job. |
| 9 | */ |
| 10 | trait WithStagingEnginePreference |
| 11 | { |
| 12 | /** @var StagingEngine */ |
| 13 | protected $stagingEngine; |
| 14 | |
| 15 | /** |
| 16 | * @return void |
| 17 | */ |
| 18 | protected function persistStagingEnginePreference() |
| 19 | { |
| 20 | if (!is_object($this->jobDataDto) || !method_exists($this->jobDataDto, 'getStagingEngine')) { |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | $this->stagingEngine->saveEngine($this->jobDataDto->getStagingEngine()); |
| 25 | } |
| 26 | } |
| 27 |