/**
  * @param ErrorDemand $demand
  */
 public function findDemanded(ErrorDemand $demand)
 {
     if (!$this->isConsistent()) {
         return null;
     }
     $minDate = $demand->getMinTime() ? new \DateTime('@' . $demand->getMinTime()) : null;
     switch ($demand->getType()) {
         case ErrorDemand::TYPE_GROUPED_BY_DAY:
             return $this->findErrorGroupedByDay($minDate, null, $demand->getUrlHash());
         case ErrorDemand::TYPE_TOP_URLS:
             return $this->findErrorTopUrls($demand->getLimit(), $minDate);
     }
     return null;
 }
 /**
  * action show
  *
  * @param \R3H6\Error404page\Domain\Model\Dto\ErrorDemand $demand
  * @return void
  */
 public function showAction(ErrorDemand $demand)
 {
     $this->view->assign('error', $this->errorRepository->findOneByUrlHash($demand->getUrlHash()));
     $this->view->assign('demand', $demand);
 }