5use Bitrix\Im\Model\EO_LinkReminder;
7use Bitrix\Im\V2\Common\ContextCustomer;
28 $this->initByDefault();
38 return LinkReminderTable::class;
58 $reminder =
new static(
$entity);
60 if (
$entity->getMessage() !==
null)
70 $reminder =
new static();
71 $reminder->setContext($context);
75 ->setAuthorId($reminder->getContext()->getUserId())
85 ->setSelect([
'ID',
'CHAT_ID',
'AUTHOR_ID',
'DATE_CREATE',
'MESSAGE_ID',
'DATE_REMIND',
'IS_REMINDED'])
87 ->where(
'AUTHOR_ID', $userId)
97 return static::initByEntity(
$entity)->setEntity($message);
122 if (!isset($option[
'WITHOUT_MESSAGES']) || $option[
'WITHOUT_MESSAGES'] ===
'N')
124 $message = $this->
getEntity()->toRestFormat();
134 'message' => $message,
145 $excludedList[] = ReminderPopupItem::class;
147 return parent::getPopupData($excludedList);
152 $additionalFields = [
154 'field' =>
'dateRemind',
155 'set' =>
'setDateRemind',
156 'get' =>
'getDateRemind',
159 'field' =>
'isReminded',
160 'set' =>
'setIsReminded',
161 'get' =>
'isReminded',
165 return array_merge(parent::mirrorDataEntityFields(), $additionalFields);
setEntityId(?int $entityId)
setEntity(RestEntity $entity)
static getRestEntityName()
static getEntityClassName()
toRestFormat(array $option=[])
setMessageId(?int $messageId)
setMessageInfo(Message $message)
getPopupData(array $excludedList=[])
__construct($source=null)
static createFromMessage(Message $message, ?Context $context=null)
setIsReminded(bool $isReminded)
static getEntityIdFieldName()
static linkEntityToMessage(RestEntity $entity, Message $message)
setDateRemind(DateTime $dateRemind)
static mirrorDataEntityFields()
static getByMessageAndUserId(Message $message, int $userId)
static initByEntity(EO_LinkReminder $entity)