/** * Tasks before insertion */ protected function before() { parent::before(); $Calculator = new Calculator($this->Object); if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) { $Calculator->tryToCorrectElevation(); } $Calculator->calculateElevation(); }
/** * Tasks before insertion */ protected function before() { parent::before(); $this->Object->set(Object::TIMESTAMP_CREATED, time()); $this->removeDataIfInside(); $this->calculateCaloriesIfZero(); $this->calculateVDOTAndIntensityAndTrimp(); $this->calculatePower(); $this->calculateStrideLength(); }
/** * Tasks before insertion */ protected function before() { parent::before(); $Calculator = new Calculator($this->Object); if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) { try { $Calculator->tryToCorrectElevation(); } catch (NoValidStrategyException $e) { // Well, obviously that did not work. Probably all API limits have been reached. } } $Calculator->calculateElevation(); }
/** * Tasks before insertion */ protected function before() { $this->calculateIfActivityWasAtNight(); parent::before(); $this->Object->set(Entity::TIMESTAMP_CREATED, time()); $this->setSportIdIfEmpty(); $this->removeDataIfInside(); $this->calculateCaloriesIfZero(); $this->calculateVDOTAndIntensityAndTrimp(); $this->calculatePower(); $this->calculateStrideLength(); $this->calculateVerticalRatio(); $this->calculateSwimValues(); }