protected function gPercent() { if (!$this->completed && !$this->inProgress) { return 0; } $percent = $this->statistic->value / $this->threshold * 100; if ($percent > 100) { $percent = 100; } return $percent; }