| @@ 13-76 (lines=64) @@ | ||
| 10 | * Class GetByIdResponse |
|
| 11 | * @package Integracao\ControlPay\Contracts\Produto |
|
| 12 | */ |
|
| 13 | class GetByIdResponse |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var \DateTime |
|
| 17 | */ |
|
| 18 | private $data; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var Terminal |
|
| 22 | */ |
|
| 23 | private $terminal; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * GetByIdResponse constructor. |
|
| 27 | */ |
|
| 28 | public function __construct() |
|
| 29 | { |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @return \DateTime |
|
| 34 | */ |
|
| 35 | public function getData() |
|
| 36 | { |
|
| 37 | return $this->data; |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @param \DateTime $data |
|
| 42 | * @return GetByIdResponse |
|
| 43 | */ |
|
| 44 | public function setData($data) |
|
| 45 | { |
|
| 46 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
|
| 47 | ||
| 48 | if(!$this->data) |
|
| 49 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 50 | ||
| 51 | return $this; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @return Terminal |
|
| 56 | */ |
|
| 57 | public function getTerminal() |
|
| 58 | { |
|
| 59 | return $this->terminal; |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * @param Terminal $terminal |
|
| 64 | * @return GetByIdResponse |
|
| 65 | */ |
|
| 66 | public function setTerminal($terminal) |
|
| 67 | { |
|
| 68 | $this->terminal = $terminal; |
|
| 69 | ||
| 70 | if(is_array($this->terminal)) |
|
| 71 | $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 72 | ||
| 73 | return $this; |
|
| 74 | } |
|
| 75 | ||
| 76 | } |
|
| @@ 12-75 (lines=64) @@ | ||
| 9 | * Class InsertResponse |
|
| 10 | * @package Integracao\ControlPay\Contracts\Produto |
|
| 11 | */ |
|
| 12 | class InsertResponse |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * @var \DateTime |
|
| 16 | */ |
|
| 17 | private $data; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var Terminal |
|
| 21 | */ |
|
| 22 | private $terminal; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * InsertResponse constructor. |
|
| 26 | */ |
|
| 27 | public function __construct() |
|
| 28 | { |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @return \DateTime |
|
| 33 | */ |
|
| 34 | public function getData() |
|
| 35 | { |
|
| 36 | return $this->data; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param \DateTime $data |
|
| 41 | * @return InsertResponse |
|
| 42 | */ |
|
| 43 | public function setData($data) |
|
| 44 | { |
|
| 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
|
| 46 | ||
| 47 | if(!$this->data) |
|
| 48 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | ||
| 50 | return $this; |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @return Terminal |
|
| 55 | */ |
|
| 56 | public function getTerminal() |
|
| 57 | { |
|
| 58 | return $this->terminal; |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @param Terminal $terminal |
|
| 63 | * @return InsertResponse |
|
| 64 | */ |
|
| 65 | public function setTerminal($terminal) |
|
| 66 | { |
|
| 67 | $this->terminal = $terminal; |
|
| 68 | ||
| 69 | if(is_array($this->terminal)) |
|
| 70 | $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 71 | ||
| 72 | return $this; |
|
| 73 | } |
|
| 74 | ||
| 75 | } |
|