StagingSiteJobsDataDto.php
228 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Staging\Dto\Job; |
| 4 | |
| 5 | use WPStaging\Framework\Job\Dto\JobDataDto; |
| 6 | use WPStaging\Framework\Job\Dto\Traits\FilesystemScannerDtoTrait; |
| 7 | use WPStaging\Framework\Job\Interfaces\FilesystemScannerDtoInterface; |
| 8 | use WPStaging\Staging\Interfaces\AdvanceStagingOptionsInterface; |
| 9 | use WPStaging\Staging\Interfaces\StagingDatabaseDtoInterface; |
| 10 | use WPStaging\Staging\Interfaces\StagingNetworkDtoInterface; |
| 11 | use WPStaging\Staging\Interfaces\StagingOperationDtoInterface; |
| 12 | use WPStaging\Staging\Interfaces\StagingSiteDtoInterface; |
| 13 | use WPStaging\Staging\Traits\StagingDatabaseDtoTrait; |
| 14 | use WPStaging\Staging\Traits\StagingNetworkDtoTrait; |
| 15 | use WPStaging\Staging\Traits\StagingOperationDtoTrait; |
| 16 | use WPStaging\Staging\Traits\WithAdvanceStagingOptions; |
| 17 | use WPStaging\Staging\Traits\WithStagingSiteDto; |
| 18 | |
| 19 | /** |
| 20 | * This is a common dto that is used for staging site jobs (create, update, reset) |
| 21 | */ |
| 22 | class StagingSiteJobsDataDto extends JobDataDto implements StagingDatabaseDtoInterface, StagingSiteDtoInterface, StagingOperationDtoInterface, AdvanceStagingOptionsInterface, FilesystemScannerDtoInterface, StagingNetworkDtoInterface |
| 23 | { |
| 24 | use FilesystemScannerDtoTrait, WithAdvanceStagingOptions, WithStagingSiteDto, StagingOperationDtoTrait, StagingDatabaseDtoTrait, StagingNetworkDtoTrait { |
| 25 | StagingOperationDtoTrait::setExcludedTables insteadof StagingDatabaseDtoTrait; |
| 26 | StagingOperationDtoTrait::getExcludedTables insteadof StagingDatabaseDtoTrait; |
| 27 | WithAdvanceStagingOptions::getDatabasePrefix insteadof StagingDatabaseDtoTrait; |
| 28 | WithAdvanceStagingOptions::setDatabasePrefix insteadof StagingDatabaseDtoTrait; |
| 29 | WithAdvanceStagingOptions::setTmpExcludedFullPaths insteadof FilesystemScannerDtoTrait; |
| 30 | WithAdvanceStagingOptions::getTmpExcludedFullPaths insteadof FilesystemScannerDtoTrait; |
| 31 | } |
| 32 | |
| 33 | /** @var string */ |
| 34 | private $cloneId = ''; |
| 35 | |
| 36 | /** @var string */ |
| 37 | private $name = ''; |
| 38 | |
| 39 | /** @var string */ |
| 40 | private $directoryName = ''; |
| 41 | |
| 42 | /** @var string */ |
| 43 | private $stagingEngine = 'next_gen'; |
| 44 | |
| 45 | /** |
| 46 | * Used in update job |
| 47 | * @var bool |
| 48 | */ |
| 49 | private $isCleanPluginsThemes = false; |
| 50 | |
| 51 | /** |
| 52 | * Used in update job |
| 53 | * @var bool |
| 54 | */ |
| 55 | private $isCleanUploads = false; |
| 56 | |
| 57 | /** |
| 58 | * Tracks if plugins cleanup is done during update |
| 59 | * @var bool |
| 60 | */ |
| 61 | private $isPluginsCleanupDone = false; |
| 62 | |
| 63 | /** |
| 64 | * Tracks if themes cleanup is done during update |
| 65 | * @var bool |
| 66 | */ |
| 67 | private $isThemesCleanupDone = false; |
| 68 | |
| 69 | /** |
| 70 | * Tracks if uploads cleanup is done during update |
| 71 | * @var bool |
| 72 | */ |
| 73 | private $isUploadsCleanupDone = false; |
| 74 | |
| 75 | /** |
| 76 | * @param string $cloneId |
| 77 | * @return void |
| 78 | */ |
| 79 | public function setCloneId(string $cloneId) |
| 80 | { |
| 81 | $this->cloneId = $cloneId; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @return string |
| 86 | */ |
| 87 | public function getCloneId(): string |
| 88 | { |
| 89 | return $this->cloneId; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @param string $name |
| 94 | * @return void |
| 95 | */ |
| 96 | public function setName(string $name) |
| 97 | { |
| 98 | $this->name = $name; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * @return string |
| 103 | */ |
| 104 | public function getName(): string |
| 105 | { |
| 106 | return $this->name; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * @param string $directoryName |
| 111 | * @return void |
| 112 | */ |
| 113 | public function setDirectoryName(string $directoryName) |
| 114 | { |
| 115 | $this->directoryName = $directoryName; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * @return string |
| 120 | */ |
| 121 | public function getDirectoryName(): string |
| 122 | { |
| 123 | return $this->directoryName; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * @param string $stagingEngine |
| 128 | * @return void |
| 129 | */ |
| 130 | public function setStagingEngine(string $stagingEngine) |
| 131 | { |
| 132 | $this->stagingEngine = $stagingEngine; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * @return string |
| 137 | */ |
| 138 | public function getStagingEngine(): string |
| 139 | { |
| 140 | return $this->stagingEngine; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * @param bool $cleanPluginsThemes |
| 145 | * @return void |
| 146 | */ |
| 147 | public function setIsCleanPluginsThemes(bool $cleanPluginsThemes) |
| 148 | { |
| 149 | $this->isCleanPluginsThemes = $cleanPluginsThemes; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * @return bool |
| 154 | */ |
| 155 | public function getIsCleanPluginsThemes(): bool |
| 156 | { |
| 157 | return $this->isCleanPluginsThemes; |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * @param bool $cleanUploads |
| 162 | * @return void |
| 163 | */ |
| 164 | public function setIsCleanUploads(bool $cleanUploads) |
| 165 | { |
| 166 | $this->isCleanUploads = $cleanUploads; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * @return bool |
| 171 | */ |
| 172 | public function getIsCleanUploads(): bool |
| 173 | { |
| 174 | return $this->isCleanUploads; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * @param bool $isPluginsCleanupDone |
| 179 | * @return void |
| 180 | */ |
| 181 | public function setIsPluginsCleanupDone(bool $isPluginsCleanupDone) |
| 182 | { |
| 183 | $this->isPluginsCleanupDone = $isPluginsCleanupDone; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * @return bool |
| 188 | */ |
| 189 | public function getIsPluginsCleanupDone(): bool |
| 190 | { |
| 191 | return $this->isPluginsCleanupDone; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * @param bool $isThemesCleanupDone |
| 196 | * @return void |
| 197 | */ |
| 198 | public function setIsThemesCleanupDone(bool $isThemesCleanupDone) |
| 199 | { |
| 200 | $this->isThemesCleanupDone = $isThemesCleanupDone; |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * @return bool |
| 205 | */ |
| 206 | public function getIsThemesCleanupDone(): bool |
| 207 | { |
| 208 | return $this->isThemesCleanupDone; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * @param bool $isUploadsCleanupDone |
| 213 | * @return void |
| 214 | */ |
| 215 | public function setIsUploadsCleanupDone(bool $isUploadsCleanupDone) |
| 216 | { |
| 217 | $this->isUploadsCleanupDone = $isUploadsCleanupDone; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * @return bool |
| 222 | */ |
| 223 | public function getIsUploadsCleanupDone(): bool |
| 224 | { |
| 225 | return $this->isUploadsCleanupDone; |
| 226 | } |
| 227 | } |
| 228 |