ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Standard.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2017 Ralph Dittrich <dittrich@qualitus.de> Extended GPL, see docs/LICENSE */
4 
6 
7 use ILIAS\UI\Component as C;
8 
13 class Standard extends ProgressMeter implements C\Chart\ProgressMeter\Standard
14 {
15 
19  protected $main_text;
20 
24  protected $required_text;
25 
29  public function getComparison()
30  {
31  return $this->getSafe($this->comparison);
32  }
33 
39  public function getComparisonAsPercent()
40  {
41  return $this->getAsPercentage($this->comparison);
42  }
43 
47  public function withMainText($text)
48  {
49  $this->checkStringArg("main_value_text", $text);
50 
51  $clone = clone $this;
52  $clone->main_text = $text;
53  return $clone;
54  }
55 
59  public function getMainText()
60  {
61  return $this->main_text;
62  }
63 
67  public function withRequiredText($text)
68  {
69  $this->checkStringArg("required_value_text", $text);
70 
71  $clone = clone $this;
72  $clone->required_text = $text;
73  return $clone;
74  }
75 
79  public function getRequiredText()
80  {
81  return $this->required_text;
82  }
83 }
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
getSafe($a_int)
Get integer value "1" if a value is negative or "maximum" if value is more then maximum.
$text
Definition: errorreport.php:18
getComparisonAsPercent()
Get comparison value as percent.
Definition: Standard.php:39
getAsPercentage($a_int)
get an integer value as percent value