Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
inoperator.php
1<?php
2
4
7
9{
10 public static function getCode(): string
11 {
12 return 'in';
13 }
14
15 public static function getTitle(): string
16 {
17 return Loc::getMessage('BIZPROC_ACTIVITY_CONDITION_OPERATORS_IN_OPERATOR_TITLE') ?? '';
18 }
19
21 {
22 parent::__construct($toCheck, $value, $fieldType);
23
24 $this->toCheck = is_array($this->toCheck) ? $this->toCheck : [$this->toCheck];
25 }
26
27 public function check(): bool
28 {
31
32 $result = false;
33 foreach (\CBPHelper::flatten($toCheck) as $f)
34 {
35 if (is_array($value))
36 {
37 $result = in_array($f, $value, false);
38 }
39 elseif (
40 \CBPHelper::hasStringRepresentation($value)
41 && \CBPHelper::hasStringRepresentation($f)
42 && (string)$f !== ''
43 )
44 {
45 $result = (mb_strpos($value, $f) !== false);
46 }
47
48 if (!$result)
49 {
50 break;
51 }
52 }
53
54 return $result;
55 }
56}
__construct($toCheck, $value, FieldType $fieldType)
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29