Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
notequaloperator.php
1<?php
2
4
7
9{
10 public static function getCode(): string
11 {
12 return '!=';
13 }
14
15 public static function getTitle(): string
16 {
17 return Loc::getMessage('BIZPROC_ACTIVITY_CONDITION_OPERATORS_NOT_EQUAL_OPERATOR_TITLE') ?? '';
18 }
19
21 {
22 parent::__construct($toCheck, $value, $fieldType);
23
24 $this->toCheck = $this->valueToArray($this->toCheck);
25 $this->value = $this->valueToArray($this->value);
26 }
27
28 public function check(): bool
29 {
32
33 $fieldCount = count($toCheck);
34 $valueCount = count($value);
35 for ($i = 0; $i < max($fieldCount, $valueCount); $i++)
36 {
37 $fieldI = ($fieldCount > $i) ? $toCheck[$i] : $toCheck[$fieldCount - 1];
38 $valueI = ($valueCount > $i) ? $value[$i] : $value[$valueCount - 1];
39
40 [$valueI, $fieldI] = static::normalizeZeroComparing($valueI, $fieldI);
41
42 if ($this->compare($fieldI, $valueI))
43 {
44 return true;
45 }
46 }
47
48 return false;
49 }
50
51 protected function compare($toCheck, $value): bool
52 {
53 $typeClass = $this->fieldType->getTypeClass();
54
55 return $typeClass::compareValues($toCheck, $value) !== 0;
56 }
57}
__construct($toCheck, $value, FieldType $fieldType)
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29