diff --git a/src/Model/PacketAttributes.php b/src/Model/PacketAttributes.php index a9d2c48..8ace643 100644 --- a/src/Model/PacketAttributes.php +++ b/src/Model/PacketAttributes.php @@ -52,6 +52,8 @@ final class PacketAttributes implements IModel private ?string $customerBarcode; + private ?Size $size; + public function __construct( string $number, @@ -75,7 +77,8 @@ public function __construct( ?string $carrierPickupPoint = null, ?string $carrierService = null, ?DispatchOrder $dispatchOrder = null, - ?string $customerBarcode = null + ?string $customerBarcode = null, + ?Size $size = null ) { $this->setNumber($number); $this->setName($name); @@ -99,6 +102,7 @@ public function __construct( $this->setCarrierService($carrierService); $this->setDispatchOrder($dispatchOrder); $this->setCustomerBarcode($customerBarcode); + $this->setSize($size); } @@ -372,6 +376,16 @@ public function setCustomerBarcode(?string $customerBarcode): void $this->customerBarcode = $customerBarcode; } + public function getSize() : ?Size + { + return $this->size; + } + + public function setSize(?Size $size) : void + { + $this->size = $size; + } + /** * @return mixed[] diff --git a/src/Model/Size.php b/src/Model/Size.php new file mode 100644 index 0000000..c1ebe88 --- /dev/null +++ b/src/Model/Size.php @@ -0,0 +1,61 @@ +setLength($length); + $this->setWidth($width); + $this->setHeight($height); + } + + public function getLength() : int + { + return $this->length; + } + + public function setLength(int $length) : void + { + $this->length = $length; + } + + public function getWidth() : int + { + return $this->width; + } + + public function setWidth(int $width) : void + { + $this->width = $width; + } + + public function getHeight() : int + { + return $this->height; + } + + public function setHeight(int $height) : void + { + $this->height = $height; + } + + + /** + * @return mixed[] + */ + public function toArray(): array + { + return get_object_vars($this); + } +}