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