• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/disk/rest/attachment.php
  • Класс: BitrixTasksIntegrationDiskRestis
  • Вызов: is::getIdByFileId
static function getIdByFileId($fileId, $ownerId, $entityId, $fieldName)
{
	static::includeDisk();

	$currentValue = static::getValue($ownerId, $entityId, $fieldName);
	foreach($currentValue as $value)
	{
		$attachedObject = AttachedObject::getById($value, array('OBJECT'));
		if($attachedObject && $attachedObject->getFile())
		{
			$attachmentFileId = $attachedObject->getObjectId();

			if((int) $attachmentFileId == (int) $fileId)
			{
				return $value;
			}
		}
	}

	return false;
}