/** * Tasks before insertion */ protected function before() { parent::before(); if ($this->hasChanged(Object::ELEVATIONS_ORIGINAL) || $this->hasChanged(Object::ELEVATIONS_CORRECTED)) { $Calculator = new Calculator($this->NewObject); $Calculator->calculateElevation(); } }
/** * Tasks before insertion */ protected function before() { $this->updateIfActivityWasAtNight(); parent::before(); $this->NewObject->set(Entity::TIMESTAMP_EDITED, time()); $this->updateVDOTAndIntensityAndTrimp(); $this->deleteIntensityCache(); $this->updatePower(); $this->updateStrideLength(); $this->updateVerticalRatio(); }
/** * Tasks before insertion */ protected function before() { parent::before(); $this->NewObject->set(Object::TIMESTAMP_EDITED, time()); $this->updateVDOTAndIntensityAndTrimp(); $this->deleteIntensityCache(); $this->updatePower(); $this->updateStrideLength(); }