50 ->setId($objectEO->getId())
51 ->setEntityId($objectEO->getObjectId())
52 ->setDateCreate($objectEO->getDateCreate())
53 ->setDateExpire($objectEO->getDateExpire())
54 ->setActive($objectEO->getActive())
55 ->setHash($objectEO->getHash())
56 ->setContactId($objectEO->getContactId())
57 ->setContactType($objectEO->getContactType())
58 ->setOwnerId($objectEO->getOwnerId())
61 $options = Json::decode($objectEO->getOptions() ??
'');
62 if (!empty($options[
'slotSize']))
64 $crmDealLink->setSlotSize($options[
'slotSize']);
67 if (!empty($options[
'channelId']))
69 $crmDealLink->setChannelId($options[
'channelId']);
72 if (!empty($options[
'senderId']))
74 $crmDealLink->setSenderId($options[
'senderId']);
77 if (!empty($options[
'lastStatus']))
79 $crmDealLink->setLastStatus($options[
'lastStatus']);
82 if (empty($crmDealLink->getContactId()) && !empty($options[
'contactId']))
84 $crmDealLink->setContactId($options[
'contactId']);
86 if (empty($crmDealLink->getContactType()) && !empty($options[
'contactType']))
88 $crmDealLink->setContactType($options[
'contactType']);
90 if (empty($crmDealLink->getOwnerId()) && !empty($options[
'ownerId']))
92 $crmDealLink->setOwnerId($options[
'ownerId']);
95 $rule = (
new Rule\Factory())->getRuleBySharingLink($crmDealLink);
96 $crmDealLink->setSharingRule($rule);
106 $baseArray = parent::convertToArray($sharingLink);
108 return array_merge($baseArray, [
109 'slotSize' => $sharingLink->getSlotSize(),
110 'channelId' => $sharingLink->getChannelId(),
111 'senderId' => $sharingLink->getSenderId(),
112 'entityId' => $sharingLink->getEntityId(),
113 'contactId' => $sharingLink->getContactId(),
114 'contactType' => $sharingLink->getContactType(),
115 'ownerId' => $sharingLink->getOwnerId(),
116 'lastStatus' => $sharingLink->getLastStatus(),