/**
  * Schedule host downtimes
  */
 public function scheduleHostDowntimeAction()
 {
     $filter = $this->getFilterOrExitIfEmpty();
     $hostList = new HostList($this->backend);
     $hostList->applyFilter($this->getRestriction('monitoring/filter/objects'))->applyFilter($filter);
     if (!$hostList->count()) {
         $this->getResponse()->json()->setFailData(array('filter' => 'No hosts found matching the filter'))->sendResponse();
     }
     $form = new ScheduleHostDowntimeCommandForm();
     $form->setIsApiTarget(true)->setBackend($this->backend)->setObjects($hostList->fetch())->handleRequest($this->getRequest());
 }
 /**
  * Schedule host downtimes
  */
 public function scheduleDowntimeAction()
 {
     $this->assertPermission('monitoring/command/downtime/schedule');
     $form = new ScheduleHostDowntimeCommandForm();
     $form->setBackend($this->backend);
     $form->setTitle($this->translate('Schedule Host Downtimes'));
     $this->handleCommandForm($form);
 }