/** * @param \Runalyze\Model\InserterWithAccountID $inserter * @return int */ protected function runInserter(\Runalyze\Model\InserterWithAccountID $inserter, $return = true) { $inserter->setAccountID(0); $inserter->insert(); if ($return) { return $inserter->insertedID(); } }
/** * 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(); }
/** * Construct inserter * @param \PDO $connection * @param \Runalyze\Model\Trackdata\Object $object [optional] */ public function __construct(\PDO $connection, Object $object = null) { parent::__construct($connection, $object); }
/** * 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(); }