| Total Complexity | 11 |
| Total Lines | 108 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class ResultAtBatchDto extends ConstructFromArrayOrJson |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $id; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | protected $success; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var bool |
||
| 21 | */ |
||
| 22 | protected $created; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * For resultId from Query batch |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $result; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var array |
||
| 33 | */ |
||
| 34 | protected $errors; |
||
| 35 | |||
| 36 | public function __construct($params = null) |
||
| 37 | { |
||
| 38 | parent::__construct($params); |
||
| 39 | if (empty($this->id) && is_string($params)) { |
||
| 40 | $this->result = $params; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getId() |
||
| 48 | { |
||
| 49 | return $this->id; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public function isSuccess() |
||
| 56 | { |
||
| 57 | return $this->success; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param bool $success |
||
| 62 | * |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | protected function setSuccess($success) |
||
| 66 | { |
||
| 67 | $this->success = (bool)$success; |
||
| 68 | return $this; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return bool |
||
| 73 | */ |
||
| 74 | public function isCreated() |
||
| 75 | { |
||
| 76 | return $this->created; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @param bool $created |
||
| 81 | * |
||
| 82 | * @return $this |
||
| 83 | */ |
||
| 84 | protected function setCreated($created) |
||
| 85 | { |
||
| 86 | $this->created = (bool)$created; |
||
| 87 | return $this; |
||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @return array |
||
| 92 | */ |
||
| 93 | public function getErrors() |
||
| 94 | { |
||
| 95 | return $this->errors; |
||
| 96 | } |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @return string |
||
| 100 | */ |
||
| 101 | public function getResult() |
||
| 104 | } |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @param string $result |
||
| 108 | * |
||
| 109 | * @return $this |
||
| 110 | */ |
||
| 111 | public function setResult($result) |
||
| 115 | } |
||
| 116 | } |