ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
- 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.

References $max_value.

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

◆ getMin()

ilADTIntegerDefinition::getMin ( )

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

References $min_value.

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

◆ getSuffix()

ilADTIntegerDefinition::getSuffix ( )

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

References $suffix.

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

◆ handleNumber()

ilADTIntegerDefinition::handleNumber ( ?int  $a_value)

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

References ILIAS\Repository\int().

Referenced by setMax(), and setMin().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isComparableTo()

ilADTIntegerDefinition::isComparableTo ( ilADT  $a_adt)

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setMax()

ilADTIntegerDefinition::setMax ( ?int  $a_value)

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

References handleNumber().

56  : void
57  {
58  $this->max_value = $this->handleNumber($a_value);
59  }
+ Here is the call graph for this function:

◆ setMin()

ilADTIntegerDefinition::setMin ( ?int  $a_value)

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

References handleNumber().

46  : void
47  {
48  $this->min_value = $this->handleNumber($a_value);
49  }
+ 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: