コード例 #1
0
 /**
  * @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();
     }
 }
コード例 #2
0
ファイル: Inserter.php プロジェクト: guancio/Runalyze
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     $Calculator = new Calculator($this->Object);
     if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) {
         $Calculator->tryToCorrectElevation();
     }
     $Calculator->calculateElevation();
 }
コード例 #3
0
ファイル: Inserter.php プロジェクト: schoch/Runalyze
 /**
  * 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();
 }
コード例 #4
0
ファイル: Inserter.php プロジェクト: aschix/Runalyze
 /**
  * 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();
 }
コード例 #5
0
ファイル: Inserter.php プロジェクト: schoch/Runalyze
 /**
  * Construct inserter
  * @param \PDO $connection
  * @param \Runalyze\Model\Trackdata\Object $object [optional]
  */
 public function __construct(\PDO $connection, Object $object = null)
 {
     parent::__construct($connection, $object);
 }
コード例 #6
0
ファイル: Inserter.php プロジェクト: rob-st/Runalyze
 /**
  * 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();
 }