ILIAS  release_7 Revision v7.30-3-g800a261c036
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
8
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 {
82 }
83}
An exception for terminatinating execution or to throw for unit testing.
getSafe($a_int)
Get integer value "1" if a value is negative or "maximum" if value is more then maximum.
getAsPercentage($a_int)
get an integer value as percent value
getComparisonAsPercent()
Get comparison value as percent.
Definition: Standard.php:39
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.