Event::updateEntity

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. Event
  4. updateEntity
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/core/mappers/event.php
  • Класс: BitrixCalendarCoreMappersEvent
  • Вызов: Event::updateEntity
protected function updateEntity($entity, array $params = []): ?CoreBaseEntityInterface
{
	$entity->setDateModified(new CoreBaseDate());
	$data = $this->convertToArray($entity);

	$params = array_merge($params, [
		'arFields' => $data,
		'originalFrom' => $params['originalFrom'] ?? null,
		'checkPermissions' => false,
		'userId' => $params['userId']
			?? $entity->getOwner() ? $entity->getOwner()->getId() : null,
	]);

	// TODO: in the future change it to call EventTable::update()
	if (($id = CCalendar::SaveEvent($params)) && is_numeric($id))
	{
		return $this->getById((int)$id);
	}

	return null;
}

Добавить комментарий