7use Bitrix\Im\Model\EO_LinkCalendar;
25 $this->initByDefault();
39 $this->
setTitle($entity->getTitle())->setDateTo(
$entity->getDateTo())->setDateFrom(
$entity->getDateFrom());
41 return parent::setEntity(
$entity);
46 $this->entity ??= Entity\Calendar\CalendarItem::initById($this->
getEntityId());
53 $ormObject = LinkCalendarTable::query()
55 ->where(
'CALENDAR_ID',
$id)
60 if ($ormObject ===
null)
67 return (
new static($ormObject))->setEntity(
Entity\Calendar\CalendarItem::initById(
$id));
70 return new static($ormObject);
75 $ormObject = LinkCalendarTable::query()
82 if ($ormObject ===
null)
87 return new static($ormObject);
92 $result = parent::save();
93 if ($result->isSuccess())
95 LinkCalendarIndexTable::indexInBackground([$this->
getId()]);
105 return parent::delete();
110 return LinkCalendarTable::class;
115 return 'CALENDAR_ID';
120 return Entity\Calendar\CalendarItem::class;
130 $additionalFields = [
131 'CALENDAR_TITLE' => [
136 'CALENDAR_DATE_FROM' => [
137 'field' =>
'dateFrom',
138 'set' =>
'setDateFrom',
139 'get' =>
'getDateFrom',
141 'CALENDAR_DATE_TO' => [
143 'set' =>
'setDateTo',
144 'get' =>
'getDateTo',
148 return array_merge(parent::mirrorDataEntityFields(), $additionalFields);
static getRestEntityName()
static getEntityClassName()
static getByCalendarId(int $id, bool $fillEntity=true)
__construct($source=null)
static getByMessageId(int $messageId)
setEntity(RestEntity $entity)
static getEntityIdFieldName()
setDateFrom(DateTime $dateFrom)
setDateTo(DateTime $dateTo)
static mirrorDataEntityFields()