• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sharing/link/factory.php
  • Класс: BitrixCalendarSharingLinkFactory
  • Вызов: Factory::createCrmDealLink
public function createCrmDealLink(
	int  $ownerId,
	int  $entityId,
	?int $contactId = null,
	?int $contactType = null,
	?string $channelId = null,
        ?string $senderId = null
): CrmDealLink
{
	$crmDealLink = (new CrmDealLink())
		->setOwnerId($ownerId)
		->setEntityId($entityId)
		->setContactType($contactType)
		->setContactId($contactId)
		->setChannelId($channelId)
            ->setSenderId($senderId)
		->setActive(true)
		->setDateExpire(
			SharingHelper::createSharingLinkExpireDate(
				new DateTime(),
				SharingLinkHelper::CRM_DEAL_SHARING_TYPE
			)
		)
	;

	(new CrmDealLinkMapper())->create($crmDealLink);

	return $crmDealLink;
}