mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 20:43:56 +00:00
53 lines
1.3 KiB
PHP
53 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\CompanyToSegmentValidation;
|
|
use App\Classes\Modules\Companies\DataTransferObjects\CompanySegmentObject;
|
|
|
|
class CanAssignSegment extends AbstractRule
|
|
{
|
|
/** @var CompanyToSegmentValidation */
|
|
private $companyToSegmentValidation;
|
|
|
|
/**
|
|
* CanAssignSegment constructor.
|
|
* @param CompanyToSegmentValidation $companyToSegmentValidation
|
|
*/
|
|
public function __construct(CompanyToSegmentValidation $companyToSegmentValidation)
|
|
{
|
|
$this->companyToSegmentValidation = $companyToSegmentValidation;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized($object): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param CompanySegmentObject $object
|
|
* @return bool
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return $this->companyToSegmentValidation->validate($object);
|
|
}
|
|
|
|
/**
|
|
* @param CompanySegmentObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
}
|