/** * Set average and maximum heartrate from array */ private function setAvgAndMaxHeartrateFromArray() { $array = $this->TrainingObject->getArrayHeartrate(); if (!empty($array) && max($array) > 30) { $array = array_filter($array, 'ParserAbstract__ArrayFilterForLowEntries'); $this->TrainingObject->setPulseAvg(round(array_sum($array) / count($array))); $this->TrainingObject->setPulseMax(max($array)); } }