protected function calculateVerticalRatioArray() { if (!$this->has(self::VERTICAL_RATIO)) { $RatioCalculator = new VerticalRatioCalculator($this); $RatioCalculator->calculate(); $this->set(self::VERTICAL_RATIO, $RatioCalculator->verticalRatioData()); } }
/** * Update vertical ratio */ protected function updateVerticalRatio() { if ($this->hasChanged(Entity::SPORTID) || $this->hasChanged(Entity::VERTICAL_OSCILLATION) || $this->hasChanged(Entity::STRIDE_LENGTH)) { $this->NewObject->set(Entity::VERTICAL_RATIO, VerticalRatioCalculator::forActivity($this->NewObject)); } }
/** * Calculate vertical ratio */ protected function calculateVerticalRatio() { if ($this->Object->sportid() == Configuration::General()->runningSport()) { $this->Object->set(Entity::VERTICAL_RATIO, \Runalyze\Calculation\Activity\VerticalRatioCalculator::forActivity($this->Object)); } }