• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documentcontroller.php
  • Класс: BitrixDiskDocumentDocumentController
  • Вызов: DocumentController::findShowSessionByCurrentUser
private function findShowSessionByCurrentUser()
{
	$filter = array(
		'OBJECT_ID' => $this->file->getRealObjectId(),
		'USER_ID' => $this->getUser()->getId(),
		'OWNER_ID' => $this->getUser()->getId(),
		'=SERVICE' => $this->documentHandler::getCode(),
		'>=CREATE_TIME' => DateTime::createFromTimestamp($this->file->getSyncUpdateTime()->getTimestamp()),
	);

	if($this->isSpecificVersion())
	{
		$filter['VERSION_ID'] = $this->versionId;
	}

	$showSessions = ShowSession::getModelList(array(
		'filter' => $filter,
		'order' => array('CREATE_TIME' => 'DESC'),
		'limit' => 1
	));

	return array_pop($showSessions);
}