• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entity/entityvalidator.php
  • Класс: Bitrix\Crm\Entity\EntityValidator
  • Вызов: EntityValidator::innerCheckFieldPresence
protected function innerCheckFieldPresence($fieldName)
{
	if($this->entityID > 0 && !array_key_exists($fieldName, $this->entityFields))
	{
		return true;
	}

	$fieldInfo = $this->getFieldInfo($fieldName);
	$typeName = is_array($fieldInfo) && isset($fieldInfo['TYPE']) ? $fieldInfo['TYPE'] : '';
	if($typeName === 'boolean')
	{
		return true;
	}

	$value = isset($this->entityFields[$fieldName]) ? $this->entityFields[$fieldName] : null;
	if(is_array($value))
	{
		return !empty($value);
	}
	return ($this->entityFields[$fieldName] ?? '') <> '';
}