/** * 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(); } } }
/** * 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(); } } }
/** * 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(); } } }