ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilADTIntegerDefinition Class Reference
+ Inheritance diagram for ilADTIntegerDefinition:
+ Collaboration diagram for ilADTIntegerDefinition:

Public Member Functions

 handleNumber (?int $a_value)
 
 getMin ()
 
 setMin (?int $a_value)
 
 getMax ()
 
 setMax (?int $a_value)
 
 getSuffix ()
 
 setSuffix (?string $a_value)
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 
- Public Member Functions inherited from ilADTDefinition
 __construct ()
 
 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 setAllowNull (bool $a_value)
 Toggle null allowed status. More...
 
 isNullAllowed ()
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 

Protected Attributes

int $min_value
 
int $max_value
 
string $suffix = ''
 
- Protected Attributes inherited from ilADTDefinition
bool $allow_null
 

Detailed Description

Definition at line 21 of file class.ilADTIntegerDefinition.php.

Member Function Documentation

◆ getMax()

ilADTIntegerDefinition::getMax ( )

Definition at line 51 of file class.ilADTIntegerDefinition.php.

51 : ?int
52 {
53 return $this->max_value;
54 }

References $max_value.

◆ getMin()

ilADTIntegerDefinition::getMin ( )

Definition at line 41 of file class.ilADTIntegerDefinition.php.

41 : ?int
42 {
43 return $this->min_value;
44 }

References $min_value.

◆ getSuffix()

ilADTIntegerDefinition::getSuffix ( )

Definition at line 61 of file class.ilADTIntegerDefinition.php.

61 : string
62 {
63 return $this->suffix;
64 }

References $suffix.

◆ handleNumber()

ilADTIntegerDefinition::handleNumber ( ?int  $a_value)

Definition at line 29 of file class.ilADTIntegerDefinition.php.

29 : ?int
30 {
31 if (!is_numeric($a_value)) {
32 $a_value = null;
33 }
34 if ($a_value !== null) {
35 // round?
36 $a_value = (int) $a_value;
37 }
38 return $a_value;
39 }

References ILIAS\Repository\int().

Referenced by setMax(), and setMin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isComparableTo()

ilADTIntegerDefinition::isComparableTo ( ilADT  $a_adt)

Check if given ADT is comparable to self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADTDefinition.

Definition at line 71 of file class.ilADTIntegerDefinition.php.

71 : bool
72 {
73 // has to be number-based
74 return ($a_adt instanceof ilADTInteger);
75 }

◆ setMax()

ilADTIntegerDefinition::setMax ( ?int  $a_value)

Definition at line 56 of file class.ilADTIntegerDefinition.php.

56 : void
57 {
58 $this->max_value = $this->handleNumber($a_value);
59 }

References handleNumber().

+ Here is the call graph for this function:

◆ setMin()

ilADTIntegerDefinition::setMin ( ?int  $a_value)

Definition at line 46 of file class.ilADTIntegerDefinition.php.

46 : void
47 {
48 $this->min_value = $this->handleNumber($a_value);
49 }

References handleNumber().

+ Here is the call graph for this function:

◆ setSuffix()

ilADTIntegerDefinition::setSuffix ( ?string  $a_value)

Definition at line 66 of file class.ilADTIntegerDefinition.php.

66 : void
67 {
68 $this->suffix = $a_value === null ? '' : trim($a_value);
69 }

Field Documentation

◆ $max_value

int ilADTIntegerDefinition::$max_value
protected

Definition at line 24 of file class.ilADTIntegerDefinition.php.

Referenced by getMax().

◆ $min_value

int ilADTIntegerDefinition::$min_value
protected

Definition at line 23 of file class.ilADTIntegerDefinition.php.

Referenced by getMin().

◆ $suffix

string ilADTIntegerDefinition::$suffix = ''
protected

Definition at line 25 of file class.ilADTIntegerDefinition.php.

Referenced by getSuffix().


The documentation for this class was generated from the following file: