- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/rooms/room.php
- Класс: BitrixCalendarRoomsRoom
- Вызов: Room::update
public function update(): Room
{
$section = SectionTable::update(
$this->id,
[
'NAME' => Emoji::encode($this->name),
'COLOR' => $this->color,
'TIMESTAMP_X' => new DateTime(),
]
);
if (!$section->isSuccess())
{
$this->addError(new Error(Loc::getMessage('EC_ROOM_SAVE_ERROR')));
return $this;
}
$this->setId($section->getId());
$location = LocationTable::update(
$this->locationId,
[
'NECESSITY' => $this->necessity,
'CAPACITY' => $this->capacity,
'CATEGORY_ID' => $this->categoryId,
]
);
if (!$location->isSuccess())
{
$this->addError(new Error(Loc::getMessage('EC_ROOM_SAVE_ERROR')));
return $this;
}
return $this;
}