Files
exchange-2.0/app/Classes/Modules/CompanyEmployees/Standards/Rules/CanCreateCompanyEmployee.php
T
2020-12-08 16:21:53 +08:00

54 lines
1.3 KiB
PHP

<?php
namespace App\Classes\Modules\CompanyEmployees\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\CompanyEmployees\DataTransferObjects\CompanyEmployeeObject;
use App\Classes\Modules\CompanyEmployees\Standards\Validators\CompanyEmployeeValidation;
class CanCreateCompanyEmployee extends AbstractRule
{
/** @var CompanyEmployeeValidation */
private $companyEmployeeValidation;
/**
* CanCreateCompanyEmployee constructor.
* @param CompanyEmployeeValidation $companyEmployeeValidation
*/
public function __construct(CompanyEmployeeValidation $companyEmployeeValidation)
{
$this->companyEmployeeValidation = $companyEmployeeValidation;
}
/**
* @return bool
*/
protected function authorized(): bool
{
// TODO Set Authorization rules
return true;
}
/**
* @param CompanyEmployeeObject $object
* @return bool
* @throws \App\Classes\Exceptions\RequestValidationException
*/
protected function validators($object): bool
{
return $this->companyEmployeeValidation->validate($object);
}
/**
* @param CompanyEmployeeObject $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}