• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Field/Photo.php
  • Класс: Bitrix\Crm\Field\Photo
  • Вызов: Photo::processLogic
protected function processLogic(Item $item, Context $context = null): Result
{
	$faceId = $item->hasField(Item::FIELD_NAME_FACE_ID) ? $item->getFaceId() : null;

	if (
		$item->isNew()
		&& $this->isItemValueEmpty($item)
		&& $faceId > 0
		&& Loader::includeModule('faceid')
	)
	{
		$face = FaceTable::getRowById($faceId);
		if ($face)
		{
			$photoId = $this->createPhotoFromFace((int)$faceId, (int)($face['FILE_ID'] ?? 0));

			$item->set(
				$this->getName(),
				$photoId,
			);
		}
	}

	return new Result();
}