/** * Schedule service downtimes */ public function scheduleServiceDowntimeAction() { $filter = $this->getFilterOrExitIfEmpty(); $serviceList = new ServiceList($this->backend); $serviceList->applyFilter($this->getRestriction('monitoring/filter/objects'))->applyFilter($filter); if (!$serviceList->count()) { $this->getResponse()->json()->setFailData(array('filter' => 'No services found matching the filter'))->sendResponse(); } $form = new ScheduleServiceDowntimeCommandForm(); $form->setIsApiTarget(true)->setBackend($this->backend)->setObjects($serviceList->fetch())->handleRequest($this->getRequest()); }