|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Jabe\Engine\Impl\Batch; |
|
4
|
|
|
|
|
5
|
|
|
class BatchConfiguration |
|
6
|
|
|
{ |
|
7
|
|
|
protected $ids = []; |
|
8
|
|
|
protected $idMappings; |
|
9
|
|
|
protected $failIfNotExists; |
|
10
|
|
|
protected $batchId; |
|
11
|
|
|
|
|
12
|
|
|
public function __construct(array $ids, $failIfNotExistsOrMappings = null, $failIfNotExistsOrBatchId = null) |
|
13
|
|
|
{ |
|
14
|
|
|
$this->ids = $ids; |
|
15
|
|
|
if ($failIfNotExistsOrMappings === null && $failIfNotExists == null) { |
|
|
|
|
|
|
16
|
|
|
$this->failIfNotExists = true; |
|
17
|
|
|
} elseif (is_bool($failIfNotExistsOrMappings)) { |
|
18
|
|
|
$this->failIfNotExists = $failIfNotExistsOrMappings; |
|
19
|
|
|
} elseif ($failIfNotExistsOrMappings instanceof DeploymentMappings) { |
|
20
|
|
|
$this->idMappings = $failIfNotExistsOrMappings; |
|
21
|
|
|
if ($failIfNotExistsOrBatchId === null) { |
|
22
|
|
|
$this->failIfNotExists = true; |
|
23
|
|
|
} elseif (is_bool($failIfNotExistsOrBatchId)) { |
|
24
|
|
|
$this->failIfNotExists = $failIfNotExistsOrBatchId; |
|
25
|
|
|
} elseif (is_string($failIfNotExistsOrBatchId)) { |
|
26
|
|
|
$this->batchId = $failIfNotExistsOrBatchId; |
|
27
|
|
|
} |
|
28
|
|
|
} |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getIds(): array |
|
32
|
|
|
{ |
|
33
|
|
|
return $this->ids; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function setIds(array $ids): void |
|
37
|
|
|
{ |
|
38
|
|
|
$this->ids = $ids; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function getIdMappings(): DeploymentMappings |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->idMappings; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function setIdMappings(DeploymentMappings $idMappings): void |
|
47
|
|
|
{ |
|
48
|
|
|
$this->idMappings = $idMappings; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function isFailIfNotExists(): bool |
|
52
|
|
|
{ |
|
53
|
|
|
return $this->failIfNotExists; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function setFailIfNotExists(bool $failIfNotExists): void |
|
57
|
|
|
{ |
|
58
|
|
|
$this->failIfNotExists = $failIfNotExists; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function getBatchId(): string |
|
62
|
|
|
{ |
|
63
|
|
|
return $this->batchId; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function setBatchId(string $batchId): void |
|
67
|
|
|
{ |
|
68
|
|
|
$this->batchId = $batchId; |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|