Exemple #1
0
 /**
  * Update basic endurance
  */
 protected function updateBasicEndurance()
 {
     $timestampLimit = time() - 182 * DAY_IN_S;
     if (($this->hasChanged(Entity::DISTANCE) || $this->hasChanged(Entity::TIMESTAMP) || $this->hasChanged(Entity::SPORTID)) && ($this->NewObject->sportid() == Configuration::General()->runningSport() && $this->NewObject->timestamp() > $timestampLimit || $this->knowsOldObject() && $this->OldObject->sportid() == Configuration::General()->runningSport() && $this->OldObject->timestamp() > $timestampLimit)) {
         BasicEndurance::recalculateValue();
     }
 }
Exemple #2
0
 /**
  * Trigger recalculation
  */
 public static function triggerRecalculation()
 {
     if (!self::$TRIGGERED) {
         self::$TRIGGERED = true;
         $oldValue = CalculationBasicEndurance::getConst();
         CalculationBasicEndurance::recalculateValue();
         $newValue = CalculationBasicEndurance::getConst();
         Messages::addValueRecalculated(__('Basic endurance'), $newValue . ' %', $oldValue . ' %');
     }
 }
Exemple #3
0
 /**
  * Update basic endurance
  */
 protected function updateBasicEndurance()
 {
     $timestampLimit = time() - 182 * DAY_IN_S;
     if ($this->Object->sportid() == Configuration::General()->runningSport() && $this->Object->timestamp() > $timestampLimit) {
         BasicEndurance::recalculateValue();
     }
 }
Exemple #4
0
 /**
  * Recalculate basic endurance
  */
 protected function recalculateBasicEndurance()
 {
     $oldValue = Configuration::Data()->basicEndurance();
     BasicEndurance::recalculateValue();
     $newValue = Configuration::Data()->basicEndurance();
     $this->addSuccessMessage(__('Basic endurance'), $oldValue, $newValue);
 }