Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
notequaloperator.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Activity\Operator
;
4
5
use
Bitrix\Bizproc\FieldType
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
class
NotEqualOperator
extends
BaseOperator
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
20
public
function
__construct
(
$toCheck
,
$value
,
FieldType
$fieldType
)
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
{
30
$toCheck
=
$this->toCheck
;
31
$value
=
$this->value
;
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
}
Bitrix\Bizproc\Activity\Operator\BaseOperator
Definition
baseoperator.php:8
Bitrix\Bizproc\Activity\Operator\BaseOperator\$value
$value
Definition
baseoperator.php:10
Bitrix\Bizproc\Activity\Operator\BaseOperator\$fieldType
FieldType $fieldType
Definition
baseoperator.php:11
Bitrix\Bizproc\Activity\Operator\BaseOperator\valueToArray
valueToArray($value)
Definition
baseoperator.php:82
Bitrix\Bizproc\Activity\Operator\BaseOperator\$toCheck
$toCheck
Definition
baseoperator.php:9
Bitrix\Bizproc\Activity\Operator\NotEqualOperator
Definition
notequaloperator.php:9
Bitrix\Bizproc\Activity\Operator\NotEqualOperator\getCode
static getCode()
Definition
notequaloperator.php:10
Bitrix\Bizproc\Activity\Operator\NotEqualOperator\check
check()
Definition
notequaloperator.php:28
Bitrix\Bizproc\Activity\Operator\NotEqualOperator\compare
compare($toCheck, $value)
Definition
notequaloperator.php:51
Bitrix\Bizproc\Activity\Operator\NotEqualOperator\__construct
__construct($toCheck, $value, FieldType $fieldType)
Definition
notequaloperator.php:20
Bitrix\Bizproc\Activity\Operator\NotEqualOperator\getTitle
static getTitle()
Definition
notequaloperator.php:15
Bitrix\Bizproc\FieldType
Definition
fieldtype.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Bizproc\Activity\Operator
Definition
baseoperator.php:3
modules
bizproc
lib
activity
operator
notequaloperator.php
Создано системой
1.10.0