mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-24 15:05:09 +00:00
packages backup
This commit is contained in:
@@ -19,7 +19,7 @@ class PackageObject implements DataTransferObject
|
||||
private $height;
|
||||
|
||||
/** @var float */
|
||||
private $lenght;
|
||||
private $length;
|
||||
|
||||
/** @var array */
|
||||
private $items;
|
||||
@@ -29,18 +29,16 @@ class PackageObject implements DataTransferObject
|
||||
* @param int $type
|
||||
* @param float $width
|
||||
* @param float $height
|
||||
* @param float $lenght
|
||||
* @param float $length
|
||||
* @param array $items
|
||||
*/
|
||||
public function __construct(int $type, float $width, float $height, float $lenght, array $items)
|
||||
public function __construct(int $type, float $width, float $height, float $length, array $items)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->width = $width;
|
||||
$this->height = $height;
|
||||
$this->lenght = $lenght;
|
||||
foreach($items as $item){
|
||||
$this->items=new ItemObject($item['description'],$item['unitOfMeasurment'],$item['quantity'],$item['price'],$item['currency']);
|
||||
}
|
||||
$this->length = $length;
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,9 +68,9 @@ class PackageObject implements DataTransferObject
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getLenght(): float
|
||||
public function getLength(): float
|
||||
{
|
||||
return $this->lenght;
|
||||
return $this->length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +78,9 @@ class PackageObject implements DataTransferObject
|
||||
*/
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
return array_map(function($item){
|
||||
return new ItemObject($item['description'],$item['unitOfMeasurment'],$item['quantity'],$item['price'],$item['currency']);
|
||||
},$this->items);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user