• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/activity/operator/containoperator.php
  • Класс: BitrixBizprocActivityOperatorContainOperator
  • Вызов: ContainOperator::check
public function check(): bool
{
	$baseType = $this->fieldType->getBaseType();
	if ($baseType === 'user')
	{
		return count(array_diff($this->value, $this->toCheck)) === 0;
	}

	$result = false;
	foreach (CBPHelper::flatten($this->value) as $v)
	{
		foreach ($this->toCheck as $f)
		{
			if (is_array($f))
			{
				$result = in_array($v, $f, false);
			}
			elseif (
				CBPHelper::hasStringRepresentation($f)
				&& CBPHelper::hasStringRepresentation($v)
				&& (string)$v !== ''
			)
			{
				$result = (mb_strpos($f, $v) !== false);
			}

			if ($result)
			{
				break;
			}
		}

		if (!$result)
		{
			break;
		}
	}

	return $result;
}