Example #1
0
 /**
  * Remove weather if sport is always inside
  */
 protected function removeWeatherIfInside()
 {
     if ($this->hasChanged(Entity::SPORTID)) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->NewObject->sportid())->isOutside()) {
             $this->NewObject->weather()->clear();
             $this->NewObject->synchronize();
         }
     }
 }
Example #2
0
 /**
  * Remove data as weather, if sport is always inside
  */
 protected function removeDataIfInside()
 {
     if ($this->Object->sportid() > 0) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->Object->sportid())->isOutside()) {
             $this->Object->weather()->clear();
             $this->Object->synchronize();
         }
     }
 }
Example #3
0
 /**
  * Remove data as weather, if sport is always inside
  */
 protected function removeDataIfInside()
 {
     if ($this->Object->sportid() > 0) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->Object->sportid())->isOutside()) {
             $this->Object->weather()->condition()->set(\Runalyze\Data\Weather\Condition::UNKNOWN);
             $this->Object->weather()->temperature()->setTemperature(null);
             $this->Object->synchronize();
         }
     }
 }