50 ->setId($objectEO->getId())
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())
59 ->setMembersHash($objectEO->getMembersHash())
60 ->setFrequentUse($objectEO->getFrequentUse())
63 if ($objectEO->getMembers()?->count() > 0)
65 $crmDealLink->setMembers((
new Member\
Manager())->createMembersFromEntityObject($objectEO->getMembers()));
68 $options = Json::decode($objectEO->getOptions() ??
'');
71 $crmDealLink->setSlotSize(
$options[
'slotSize']);
76 $crmDealLink->setChannelId(
$options[
'channelId']);
81 $crmDealLink->setSenderId(
$options[
'senderId']);
86 $crmDealLink->setLastStatus(
$options[
'lastStatus']);
89 if (empty($crmDealLink->getContactId()) && !empty(
$options[
'contactId']))
91 $crmDealLink->setContactId(
$options[
'contactId']);
93 if (empty($crmDealLink->getContactType()) && !empty(
$options[
'contactType']))
95 $crmDealLink->setContactType(
$options[
'contactType']);
97 if (empty($crmDealLink->getOwnerId()) && !empty(
$options[
'ownerId']))
99 $crmDealLink->setOwnerId(
$options[
'ownerId']);
102 $rule = (
new Rule\Factory())->getRuleBySharingLink($crmDealLink);
103 $crmDealLink->setSharingRule($rule);
113 $baseArray = parent::convertToArray($sharingLink);
115 return array_merge($baseArray, [
116 'slotSize' => $sharingLink->getSlotSize(),
117 'channelId' => $sharingLink->getChannelId(),
118 'senderId' => $sharingLink->getSenderId(),
119 'entityId' => $sharingLink->getEntityId(),
120 'contactId' => $sharingLink->getContactId(),
121 'contactType' => $sharingLink->getContactType(),
122 'ownerId' => $sharingLink->getOwnerId(),
123 'lastStatus' => $sharingLink->getLastStatus(),