コード例 #1
0
 public function execute(IWebRequest $request, IWebResponse $response)
 {
     $feeding = $this->feedingRepository->getInProgress();
     if ($feeding->hasBottle()) {
         $response->redirect('/bottle');
     } else {
         if ($feeding->hasMilking()) {
             $response->redirect('/milking');
         } else {
             if ($feeding->hasBreastFeeding()) {
                 $response->redirect('/breast');
             } else {
                 if ($feeding->hasDiaper()) {
                     $response->redirect('/diaper');
                 }
             }
         }
     }
     return $this->model;
 }
コード例 #2
0
 public function execute(IWebRequest $request, IWebResponse $response)
 {
     $this->model->setTemplateName($this->getTemplateName());
     $this->model->setFeeding($this->feedingRepository->getInProgress());
     $feeding = $this->model->getFeeding();
     if ($feeding->hasBottle() && !$this->stringHelper->startsWith($request->path(), '/bottle')) {
         $response->redirect('/bottle');
     } else {
         if ($feeding->hasMilking() && !$this->stringHelper->startsWith($request->path(), '/milking')) {
             $response->redirect('/milking');
         } else {
             if ($feeding->hasBreastFeeding() && !$this->stringHelper->startsWith($request->path(), '/breast')) {
                 $response->redirect('/breast');
             } else {
                 if ($feeding->hasDiaper() && !$this->stringHelper->startsWith($request->path(), '/diaper')) {
                     $response->redirect('/diaper');
                 }
             }
         }
     }
     return $this->model;
 }
コード例 #3
0
 /**
  * Red
  * @return HtmlExecutionRecorder
  */
 function putError($msg)
 {
     $this->response->out($this->colorize($msg, 'red'));
     return $this;
 }