mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Companies\Standards\Rules;
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
|
use App\Classes\Modules\Documents\Standards\Validators\DocumentValidation;
|
|
|
|
class CanCreateIdentificationDocument extends AbstractRule
|
|
{
|
|
|
|
/** @var DocumentValidation */
|
|
private $documentValidation;
|
|
|
|
/**
|
|
* CanCreateAddress constructor.
|
|
* @param DocumentValidation $documentValidation
|
|
*/
|
|
public function __construct(DocumentValidation $documentValidation)
|
|
{
|
|
$this->documentValidation = $documentValidation;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized($object): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param DocumentObject $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->documentValidation->validate($object);
|
|
}
|
|
|
|
/**
|
|
* @param DocumentObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
} |