Exemplo n.º 1
0
 /**
  * @param Request $request
  * @return Response
  */
 public function processRequest(Request $request)
 {
     $taskIds = TaskManager::getInstance()->getTaskIdsByToken($request->getToken());
     $taskDescriptions = array_map(array($this, 'getDescriptionForTask'), $taskIds);
     $response = new Response();
     $response->setPayload(array_combine($taskIds, $taskDescriptions));
     $response->setReport(new SuccessReport('Tasks', 'Select task from list'));
     return $response;
 }
Exemplo n.º 2
0
 /**
  * @param string $title
  * @param string $content
  * @param Request $request
  * @return Response
  */
 protected function createErrorResponse($title, $content, Request $request)
 {
     $errorReport = new ErrorReport($title, $content);
     $response = new Response();
     $response->setReport($errorReport);
     $response->setToken($request->getToken());
     $response->complete();
     return $response;
 }