• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/EditorAdapter.php
  • Класс: Bitrix\Crm\Service\EditorAdapter
  • Вызов: EditorAdapter::findDeletedEntries
protected function findDeletedEntries(array $existingEntries, array $sentEntries, $arrayKey): array
{
	// crm editor sends all existing entries (e.g., all products, contacts).
	// If some of them were not sent, it means they were deleted.
	$deletedEntries = [];
	foreach ($existingEntries as $existing)
	{
		$wasFound = false;
		foreach ($sentEntries as $sent)
		{
			if (isset($sent[$arrayKey]) && $sent[$arrayKey] === $existing[$arrayKey])
			{
				$wasFound = true;
			}
		}

		if (!$wasFound)
		{
			$deletedEntries[] = $existing[$arrayKey];
		}
	}

	return $deletedEntries;
}