예제 #1
0
 /**
  * Set average temperature from array
  */
 private function setTemperatureFromArray()
 {
     $array = $this->TrainingObject->getArrayTemperature();
     if (!empty($array) && (min($array) != max($array) || min($array) != 0)) {
         $this->TrainingObject->setTemperature(round(array_sum($array) / count($array)));
     }
 }
 /**
  * Set average temperature from array
  */
 private function setTemperatureFromArray()
 {
     if (!Configuration::ActivityForm()->loadWeather()) {
         $array = $this->TrainingObject->getArrayTemperature();
         if (!empty($array) && (min($array) != max($array) || min($array) != 0)) {
             $this->TrainingObject->setTemperature(round(array_sum($array) / count($array)));
         }
     }
 }