• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/schedule/scheduleassignmentsservice.php
  • Класс: BitrixTimemanServiceSchedulefor
  • Вызов: for::deleteUserAssignments
public function deleteUserAssignments($scheduleId, $userIds)
{
	return $this->wrapAction(function () use ($scheduleId, $userIds) {

		$scheduleForm = new ScheduleForm();
		$scheduleForm->id = $scheduleId;
		$scheduleForm->userIdsExcluded = $userIds;

		if (!$scheduleForm->validate(['userIdsExcluded', 'scheduleId']))
		{
			return (new ScheduleServiceResult())->addError($scheduleForm->getFirstError());
		}

		$this->safeRun($this->insertUsersAssignment($scheduleId, $scheduleForm->userIdsExcluded, true));
		return $this->buildResultWithSchedule(
			$this->findScheduleWithUsers($scheduleId)
		);
	});
}