mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 22:44:03 +00:00
large commit
This commit is contained in:
@@ -2,141 +2,79 @@
|
||||
|
||||
namespace App\Classes\Modules\Documents\DataTransferObjects;
|
||||
|
||||
use App\Classes\Interfaces\DataTransferObject;
|
||||
use App\Classes\General\Interfaces\DataTransferObject;
|
||||
use App\Classes\Modules\Documents\Services\ConvertsBase64ToFile;
|
||||
|
||||
class DocumentObject implements DataTransferObject
|
||||
{
|
||||
/** @var int|null */
|
||||
private $owner_id;
|
||||
|
||||
/** @var int|null */
|
||||
private $owner_type;
|
||||
|
||||
/** @var string|null */
|
||||
/** @var string */
|
||||
private $document_type;
|
||||
|
||||
/** @var string|null */
|
||||
/** @var array */
|
||||
private $files;
|
||||
|
||||
/** @var string */
|
||||
private $reference;
|
||||
|
||||
/** @var int|null */
|
||||
/** @var int */
|
||||
private $status;
|
||||
|
||||
/** @var int|null */
|
||||
private $approved_by;
|
||||
|
||||
/** @var timestamp|null */
|
||||
private $issued_date;
|
||||
|
||||
/** @var timestamp|null */
|
||||
private $expired_date;
|
||||
|
||||
/** @var timestamp|null */
|
||||
private $approved_date;
|
||||
/** @var string|null */
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* CompanyObject constructor.
|
||||
* @param int|null $owner_id
|
||||
* @param int|null $owner_type
|
||||
* @param null|string $document_type
|
||||
* @param string|null $reference
|
||||
* @param int|null $status
|
||||
* @param int|null $approved_by
|
||||
* @param timestamp|null $issued_date
|
||||
* @param timestamp|null $expired_date
|
||||
* @param timestamp|null $approved_date
|
||||
* DocumentObject constructor.
|
||||
* @param string $document_type
|
||||
* @param array $files
|
||||
* @param string $reference
|
||||
* @param int $status
|
||||
* @param null|string $path
|
||||
*/
|
||||
public function __construct(
|
||||
?int $owner_id,
|
||||
?int $owner_type,
|
||||
?string $document_type,
|
||||
?string $reference,
|
||||
?int $status,
|
||||
?int $approved_by,
|
||||
?timestamp $issued_date,
|
||||
?timestamp $expired_date,
|
||||
?timestamp $approved_date
|
||||
)
|
||||
public function __construct(string $document_type, array $files, string $reference, int $status, ?string $path = '')
|
||||
{
|
||||
$this->owner_id = $owner_id;
|
||||
$this->owner_type = $owner_type;
|
||||
$this->document_type = $document_type;
|
||||
$this->files = $files;
|
||||
$this->reference = $reference;
|
||||
$this->status = $status;
|
||||
$this->approved_by = $approved_by;
|
||||
$this->issued_date = $issued_date;
|
||||
$this->expired_date = $expired_date;
|
||||
$this->approved_date = $approved_date;
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getOwnerId(): ?int
|
||||
{
|
||||
return $this->owner_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return string
|
||||
*/
|
||||
public function getOwnerType(): ?int
|
||||
{
|
||||
return $this->owner_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDocumentType(): ?string
|
||||
public function getDocumentType(): string
|
||||
{
|
||||
return $this->document_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getReference(): ?string
|
||||
public function getReference(): string
|
||||
{
|
||||
return $this->reference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getStatus(): ?int
|
||||
public function getStatus(): int
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getApprovedBy(): ?int
|
||||
{
|
||||
return $this->approved_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return timestamp|null
|
||||
* @return array
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function getIssuedDate(): ?timestamp
|
||||
public function getFiles(): array
|
||||
{
|
||||
return $this->issued_date;
|
||||
return (new ConvertsBase64ToFile($this->path))->convert($this->files);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return timestamp|null
|
||||
*/
|
||||
public function getExpiredDate(): ?timestamp
|
||||
{
|
||||
return $this->expired_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return timestamp|null
|
||||
*/
|
||||
public function getApprovedDate(): ?timestamp
|
||||
{
|
||||
return $this->approved_date;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user