• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/ViewedService.php
  • Класс: BitrixImV2MessageViewedService
  • Вызов: ViewedService::getDateViewedByMessageId
public function getDateViewedByMessageId(int $messageId): ?DateTime
{
	$result = MessageViewedTable::query() //todo: add unique index (MESSAGE_ID, USER_ID, DATE_CREATE)
		->setSelect(['DATE_CREATE'])
		->where('USER_ID', $this->getContext()->getUserId())
		->where('MESSAGE_ID', $messageId)
		->fetch()
	;

	return $result ? $result['DATE_CREATE'] : null;
}