ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 {
16 $a_value = null;
17 }
18 if($a_value !== null)
19 {
20 // round?
21 $a_value = (int)$a_value;
22 }
23 return $a_value;
24 }
25
26 public function getMin()
27 {
28 return $this->min;
29 }
30
31 public function setMin($a_value)
32 {
33 $this->min = $this->handleNumber($a_value);
34 }
35
36 public function getMax()
37 {
38 return $this->max;
39 }
40
41 public function setMax($a_value)
42 {
43 $this->max = $this->handleNumber($a_value);
44 }
45
46 public function getSuffix()
47 {
48 return $this->suffix;
49 }
50
51 public function setSuffix($a_value)
52 {
53 $this->suffix = trim($a_value);
54 }
55
56
57 // comparison
58
59 public function isComparableTo(ilADT $a_adt)
60 {
61 // has to be number-based
62 return ($a_adt instanceof ilADTInteger);
63 }
64}
65
66?>
ADT definition base class.
isComparableTo(ilADT $a_adt)
Check if given ADT is comparable to self.
ADT base class.
Definition: class.ilADT.php:12