mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
58 lines
1.2 KiB
PHP
58 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Schedules\Standards\Rules;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
|
|
use App\Classes\Modules\Schedules\Standards\Validators\ScheduleValidation;
|
|
|
|
class CanUpdateSchedule extends AbstractRule
|
|
{
|
|
|
|
/** @var ScheduleValidation */
|
|
private $ScheduleValidation;
|
|
|
|
/**
|
|
* CanUpdateSchedule constructor.
|
|
* @param ScheduleValidation $ScheduleValidation
|
|
*/
|
|
public function __construct(ScheduleValidation $ScheduleValidation)
|
|
{
|
|
$this->ScheduleValidation = $ScheduleValidation;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized($object): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
return true;
|
|
|
|
}
|
|
|
|
/**
|
|
* @param ScheduleObject $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->ScheduleValidation->validate($object);
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* @param ScheduleObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
}
|