mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-24 23:14:16 +00:00
big commit
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Documents\DataTransferObjects;
|
||||
|
||||
use App\Classes\Interfaces\DataTransferObject;
|
||||
use App\Classes\Modules\Documents\Services\ConvertsBase64ToFile;
|
||||
|
||||
class DocumentObject implements DataTransferObject
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
private $document_type;
|
||||
|
||||
/** @var array */
|
||||
private $files;
|
||||
|
||||
/** @var string|null */
|
||||
private $reference;
|
||||
|
||||
/**
|
||||
* DocumentObject constructor.
|
||||
* @param string $document_type
|
||||
* @param array $files
|
||||
* @param null|string $reference
|
||||
*/
|
||||
public function __construct(string $document_type, array $files, ?string $reference = null)
|
||||
{
|
||||
$this->document_type = $document_type;
|
||||
$this->files = $files;
|
||||
$this->reference = $reference;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDocumentType(): string
|
||||
{
|
||||
return $this->document_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getReference(): string
|
||||
{
|
||||
return $this->reference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function getFiles(): array
|
||||
{
|
||||
return (new ConvertsBase64ToFile())->convert($this->files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user