Ejemplo n.º 1
0
 /**
  * action show
  *
  * @param \Woehrl\WoehrlFilialsuche\Domain\Model\Filiale $filiale
  * @return void
  */
 public function showAction(\Woehrl\WoehrlFilialsuche\Domain\Model\Filiale $filiale)
 {
     $plz = $filiale->getPlz();
     $radius = $filiale->getRadius();
     if ($plz) {
         //$filiale->modehaeuser = $this->ogdbRadius($filiale->getPlz(), $radius);
         $filiale->modehaeuser = ogdbRadius($filiale->getPlz(), $radius);
         //\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($filiale, 'filiales');
         $lat_pos = NULL;
         $lon_pos = NULL;
         foreach ($filiale->modehaeuser as $modehaus) {
             if (empty($lat_pos) and empty($lon_pos)) {
                 $lat_pos = $modehaus['lat_pos'];
                 $lon_pos = $modehaus['lon_pos'];
             }
             $distanceArray[] = $modehaus['distance'];
         }
         // \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($distanceArray, 'filiales');
         if ($distanceArray) {
             $distanceDiff = max($distanceArray) - min($distanceArray);
             if ($distanceDiff < 10) {
                 $zoom = 15;
             } elseif ($distanceDiff > 10 and $distanceDiff < 50) {
                 $zoom = 10;
             } else {
                 $zoom = 8;
             }
             $filiale->zoom = $zoom;
             $filiale->lat_pos = $lat_pos;
             $filiale->lon_pos = $lon_pos;
         } else {
             $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', 'Leider wurde keine Filiale zu Ihren Sucheingaben gefunden.', 'Ooops!', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, TRUE);
             // $this->flashMessageContainer->add('Leider wurde keine Filiale zu Ihren Sucheingaben gefunden.');
             \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($message);
             $this->view->assign('filiale', $filiale);
             $this->redirect('list');
             //$this->redirect('list', NULL,NULL ,array('notfound'=>1));
         }
     } else {
         $filiale->modehaeuser = 2;
     }
     $this->view->assign('filiale', $filiale);
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function setAdresseForStringSetsAdresse()
 {
     $this->subject->setAdresse('Conceived at T3CON10');
     $this->assertAttributeEquals('Conceived at T3CON10', 'adresse', $this->subject);
 }