18 parent::__construct();
19 if (Loader::includeModule(
'crm'))
31 || !Loader::includeModule(
'crm')
32 || $this->getContext()->getUser()->isExtranet()
38 return \Bitrix\Im\Integration\Crm\Common::getLink($this->crmType, $this->crmId);
43 if ($this->isExpectedType($this->type))
48 return self::DYNAMIC_TYPE;
53 $separatedEntityId = explode(
'|', $rawCrmData);
54 $this->crmType = $separatedEntityId[0] ??
'';
55 $this->crmId = (int)($separatedEntityId[1] ?? 0);
58 private function getExpectedType():
array
60 if (!Loader::includeModule(
'crm'))
66 \CCrmOwnerType::LeadName => \CCrmOwnerType::LeadName,
67 \CCrmOwnerType::DealName => \CCrmOwnerType::DealName,
68 \CCrmOwnerType::ContactName => \CCrmOwnerType::ContactName,
69 \CCrmOwnerType::CompanyName => \CCrmOwnerType::CompanyName,
73 private function isExpectedType(
string $type): bool
75 return isset($this->getExpectedType()[
$type]);