Files
portal/app/Classes/Modules/Packages/DataTransferObjects/PackageObject.php
T
2021-01-05 13:39:31 +05:30

88 lines
1.9 KiB
PHP

<?php
namespace App\Classes\Modules\Packages\DataTransferObjects;
use App\Classes\Interfaces\DataTransferObject;
use App\Classes\Modules\Packages\DataTransferObjects\ItemObject;
class PackageObject implements DataTransferObject
{
/** @var int */
private $type;
/** @var float */
private $width;
/** @var float */
private $height;
/** @var float */
private $lenght;
/** @var array */
private $items;
/**
* PackageObject constructor.
* @param int $type
* @param float $width
* @param float $height
* @param float $lenght
* @param array $items
*/
public function __construct(int $type, float $width, float $height, float $lenght, 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']);
}
}
/**
* @return int
*/
public function getType(): int
{
return $this->type;
}
/**
* @return float
*/
public function getWidth(): float
{
return $this->width;
}
/**
* @return float
*/
public function getHeight(): float
{
return $this->height;
}
/**
* @return float
*/
public function getLenght(): float
{
return $this->lenght;
}
/**
* @return array
*/
public function getItems(): array
{
return $this->items;
}
}