Exemplo n.º 1
0
 static function getPrevisionValue(&$arrayEveryDay, PrevisionDate $previsionDate, $webSiteName)
 {
     if (!array_key_exists($previsionDate->getDatePrev()->format('Y-m-d'), $arrayEveryDay)) {
         $arrayEveryDay[$previsionDate->getDatePrev()->format('Y-m-d')] = AllPrevGetData::createArrayEveryHoure();
         // tableau de toutes les heures
     }
     $listPrevision = $previsionDate->getListPrevision();
     $prevHour = 0;
     $prevOrient = 0;
     $prevWind = 0;
     foreach ($listPrevision as $prevision) {
         $wind = $prevision->getWind();
         $orientation = WebsiteGetData::transformeOrientationDeg($prevision->getOrientation());
         $hour = intval($prevision->getTime()->format('H'));
         $arrayEveryDay[$previsionDate->getDatePrev()->format('Y-m-d')][$hour]['wind'][$webSiteName] = $wind;
         $arrayEveryDay[$previsionDate->getDatePrev()->format('Y-m-d')][$hour]['orient'][$webSiteName] = $orientation;
         AllPrevGetData::completeArrayPrevision($arrayEveryDay[$previsionDate->getDatePrev()->format('Y-m-d')], $webSiteName, $wind, $orientation, $hour, $prevWind, $prevOrient, $prevHour);
         $prevHour = $hour;
         $prevOrient = $orientation;
         $prevWind = $wind;
     }
 }