mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
98 lines
1.9 KiB
PHP
98 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Transports\DataTransferObjects;
|
|
|
|
use App\Classes\General\Interfaces\DataTransferObject;
|
|
use Carbon\Carbon;
|
|
|
|
class TransportObject implements DataTransferObject
|
|
{
|
|
|
|
/** @var string */
|
|
private $type;
|
|
|
|
/** @var string|null */
|
|
private $courier;
|
|
|
|
/** @var int */
|
|
private $tracking_number;
|
|
|
|
/** @var int */
|
|
private $dispacth_date;
|
|
|
|
/** @var int */
|
|
private $drop_date;
|
|
|
|
/** @var int */
|
|
private $status;
|
|
|
|
/**
|
|
* TransportObject constructor.
|
|
* @param string $type
|
|
* @param null|string $courier
|
|
* @param int $tracking_number
|
|
* @param int $dispatch_date
|
|
* @param int $drop_date
|
|
* @param int $status
|
|
*/
|
|
public function __construct(string $type, string $courier, int $tracking_number, ?string $dispatch_date, ?string $drop_date, int $status)
|
|
{
|
|
$this->type = $type;
|
|
$this->courier = $courier;
|
|
$this->tracking_number = $tracking_number;
|
|
$this->dispatch_date = $dispatch_date;
|
|
$this->drop_date = $drop_date;
|
|
$this->status = $status;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getType(): string
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
/**
|
|
* @return null|string
|
|
*/
|
|
public function getCourier(): ?string
|
|
{
|
|
return $this->courier;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getTrackingNumber(): int
|
|
{
|
|
return $this->tracking_number;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getDispatchDate(): ?Carbon
|
|
{
|
|
return $this->dispatch_date ? Carbon::parse($this->dispatch_date) : null;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getDropDate(): ?Carbon
|
|
{
|
|
return $this->drop_date ? Carbon::parse($this->drop_date) : null;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getStatus(): int
|
|
{
|
|
return $this->status;
|
|
}
|
|
|
|
|
|
}
|