Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/bizproc/lib/activity/operator/ |
Upload File : |
<?php namespace Bitrix\Bizproc\Activity\Operator; use Bitrix\Bizproc\FieldType; use Bitrix\Main\Localization\Loc; class InOperator extends BaseOperator { public static function getCode(): string { return 'in'; } public static function getTitle(): string { return Loc::getMessage('BIZPROC_ACTIVITY_CONDITION_OPERATORS_IN_OPERATOR_TITLE') ?? ''; } public function __construct($toCheck, $value, FieldType $fieldType) { parent::__construct($toCheck, $value, $fieldType); $this->toCheck = is_array($this->toCheck) ? $this->toCheck : [$this->toCheck]; } public function check(): bool { $toCheck = $this->toCheck; $value = $this->value; $result = false; foreach (\CBPHelper::flatten($toCheck) as $f) { if (is_array($value)) { $result = in_array($f, $value, false); } elseif ( \CBPHelper::hasStringRepresentation($value) && \CBPHelper::hasStringRepresentation($f) && (string)$f !== '' ) { $result = (mb_strpos($value, $f) !== false); } if (!$result) { break; } } return $result; } }