| 1 |
<?php |
| 2 |
|
| 3 |
namespace IvyForms\Entity\Payment; |
| 4 |
|
| 5 |
use IvyForms\ValueObjects\Payment\Order as OrderValueObject; |
| 6 |
|
| 7 |
/** |
| 8 |
* Order entity wrapping the value object. |
| 9 |
*/ |
| 10 |
class Order |
| 11 |
{ |
| 12 |
private OrderValueObject $order; |
| 13 |
|
| 14 |
public function __construct(OrderValueObject $order) |
| 15 |
{ |
| 16 |
$this->order = $order; |
| 17 |
} |
| 18 |
|
| 19 |
public function getId(): int |
| 20 |
{ |
| 21 |
return $this->order->id; |
| 22 |
} |
| 23 |
|
| 24 |
public function setId(int $id): void |
| 25 |
{ |
| 26 |
$this->order->id = $id; |
| 27 |
} |
| 28 |
|
| 29 |
public function getEntryId(): int |
| 30 |
{ |
| 31 |
return $this->order->entryId; |
| 32 |
} |
| 33 |
|
| 34 |
public function getSquareOrderId(): string |
| 35 |
{ |
| 36 |
return $this->order->squareOrderId; |
| 37 |
} |
| 38 |
|
| 39 |
public function getStatus(): string |
| 40 |
{ |
| 41 |
return $this->order->status; |
| 42 |
} |
| 43 |
|
| 44 |
public function setStatus(string $status): void |
| 45 |
{ |
| 46 |
$this->order->status = $status; |
| 47 |
} |
| 48 |
|
| 49 |
public function getSquareCustomerId(): ?string |
| 50 |
{ |
| 51 |
return $this->order->squareCustomerId; |
| 52 |
} |
| 53 |
|
| 54 |
public function getAmount(): int |
| 55 |
{ |
| 56 |
return $this->order->amount; |
| 57 |
} |
| 58 |
|
| 59 |
public function getCurrency(): string |
| 60 |
{ |
| 61 |
return $this->order->currency; |
| 62 |
} |
| 63 |
|
| 64 |
public function getDateCreated(): ?string |
| 65 |
{ |
| 66 |
return $this->order->dateCreated; |
| 67 |
} |
| 68 |
|
| 69 |
public function setDateCreated(string $dateCreated): void |
| 70 |
{ |
| 71 |
$this->order->dateCreated = $dateCreated; |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* @return mixed[] |
| 76 |
*/ |
| 77 |
public function toArray(): array |
| 78 |
{ |
| 79 |
return $this->order->toArray(); |
| 80 |
} |
| 81 |
} |
| 82 |
|