ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTIntegerDefinition.php
Go to the documentation of this file.
1<?php
2
4{
5 protected $min_value; // [int]
6 protected $max_value; // [int]
7 protected $suffix; // [string]
8
9
10 // properties
11
12 public function handleNumber($a_value)
13 {
14 if (!is_numeric($a_value)) {
15 $a_value = null;
16 }
17 if ($a_value !== null) {
18 // round?
19 $a_value = (int) $a_value;
20 }
21 return $a_value;
22 }
23
24 public function getMin()
25 {
26 return $this->min;
27 }
28
29 public function setMin($a_value)
30 {
31 $this->min = $this->handleNumber($a_value);
32 }
33
34 public function getMax()
35 {
36 return $this->max;
37 }
38
39 public function setMax($a_value)
40 {
41 $this->max = $this->handleNumber($a_value);
42 }
43
44 public function getSuffix()
45 {
46 return $this->suffix;
47 }
48
49 public function setSuffix($a_value)
50 {
51 $this->suffix = trim($a_value);
52 }
53
54
55 // comparison
56
57 public function isComparableTo(ilADT $a_adt)
58 {
59 // has to be number-based
60 return ($a_adt instanceof ilADTInteger);
61 }
62}
An exception for terminatinating execution or to throw for unit testing.
ADT definition base class.
isComparableTo(ilADT $a_adt)
Check if given ADT is comparable to self.
ADT base class.
Definition: class.ilADT.php:12