ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Standard.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\UI\Component as C;
24 
29 class Standard extends ProgressMeter implements C\Chart\ProgressMeter\Standard
30 {
31  protected ?string $main_text = null;
32  protected ?string $required_text = null;
33 
37  public function getComparison()
38  {
39  return $this->getSafe($this->comparison);
40  }
41 
45  public function getComparisonAsPercent(): int
46  {
47  return $this->getAsPercentage($this->comparison);
48  }
49 
53  public function withMainText(string $text): C\Chart\ProgressMeter\ProgressMeter
54  {
55  $this->checkStringArg("main_value_text", $text);
56 
57  $clone = clone $this;
58  $clone->main_text = $text;
59  return $clone;
60  }
61 
65  public function getMainText(): ?string
66  {
67  return $this->main_text;
68  }
69 
73  public function withRequiredText(string $text): C\Chart\ProgressMeter\ProgressMeter
74  {
75  $this->checkStringArg("required_value_text", $text);
76 
77  $clone = clone $this;
78  $clone->required_text = $text;
79  return $clone;
80  }
81 
85  public function getRequiredText(): ?string
86  {
87  return $this->required_text;
88  }
89 }
getAsPercentage(int $int)
get an integer value as percent value
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getSafe(int $int)
Get integer value "1" if a value is negative or "maximum" if value is more than maximum.
getComparisonAsPercent()
Get comparison value as percent.
Definition: Standard.php:45