tenweb-speed-optimizer
/
vendor
/
10web-utils
/
10web-queue
/
src
/
TenWebQueue
/
DTO
/
QueueConfigDTO.php
tenweb-speed-optimizer
/
vendor
/
10web-utils
/
10web-queue
/
src
/
TenWebQueue
/
DTO
Last commit date
QueueConfigDTO.php
4 years ago
QueueDataDTO.php
4 years ago
QueueConfigDTO.php
79 lines
| 1 | <?php |
| 2 | namespace TenWebQueue\DTO; |
| 3 | |
| 4 | class QueueConfigDTO |
| 5 | { |
| 6 | /** |
| 7 | * @var string |
| 8 | */ |
| 9 | public $connectionType = 'file'; |
| 10 | |
| 11 | /** |
| 12 | * @var string |
| 13 | */ |
| 14 | public $fileConnectionPath = ''; |
| 15 | |
| 16 | /** |
| 17 | * @var QueueDataDTO |
| 18 | */ |
| 19 | public $queueData; |
| 20 | |
| 21 | /** |
| 22 | * @var string |
| 23 | */ |
| 24 | public $restartFilePath = ''; |
| 25 | |
| 26 | /** |
| 27 | * @var string |
| 28 | */ |
| 29 | public $restartRoute = ''; |
| 30 | |
| 31 | /** |
| 32 | * @var array |
| 33 | */ |
| 34 | public $restartBody = array(); |
| 35 | |
| 36 | /** |
| 37 | * @var int |
| 38 | */ |
| 39 | public $itemsCountForRestart = 20; |
| 40 | |
| 41 | /** |
| 42 | * @var bool |
| 43 | */ |
| 44 | public $force = false; |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | * @param $data |
| 49 | */ |
| 50 | public function __construct($data = array()) |
| 51 | { |
| 52 | if (!empty($data['connection_type'])) { |
| 53 | $this->connectionType = $data['connection_type']; |
| 54 | } |
| 55 | |
| 56 | if (!empty($data['file_connection_path'])) { |
| 57 | $this->fileConnectionPath = $data['file_connection_path']; |
| 58 | } |
| 59 | if (!empty($data['queue_data'])) { |
| 60 | $this->queueData = $data['queue_data']; |
| 61 | } |
| 62 | if (!empty($data['restart_file_path'])) { |
| 63 | $this->restartFilePath = $data['restart_file_path']; |
| 64 | } |
| 65 | if (!empty($data['restart_route'])) { |
| 66 | $this->restartRoute = $data['restart_route']; |
| 67 | } |
| 68 | if (!empty($data['restart_body'])) { |
| 69 | $this->restartBody = $data['restart_body']; |
| 70 | } |
| 71 | if (!empty($data['items_count_for_restart'])) { |
| 72 | $this->itemsCountForRestart = $data['items_count_for_restart']; |
| 73 | } |
| 74 | if (!empty($data['force'])) { |
| 75 | $this->force = $data['force']; |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 |