ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ilADTFloatDefinition Class Reference
+ Inheritance diagram for ilADTFloatDefinition:
+ Collaboration diagram for ilADTFloatDefinition:

Public Member Functions

 handleNumber ($a_value)
 
 getMin ()
 
 setMin (?float $a_value)
 
 getMax ()
 
 setMax (?float $a_value)
 
 getSuffix ()
 
 setSuffix (?string $a_value)
 
 isComparableTo (ilADT $a_adt)
 
 reset ()
 
 getDecimals ()
 
 setDecimals (int $a_value)
 
- 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 $decimals
 
float $min_value
 
float $max_value
 
string $suffix = ''
 
- Protected Attributes inherited from ilADTDefinition
bool $allow_null
 

Detailed Description

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

Member Function Documentation

◆ getDecimals()

ilADTFloatDefinition::getDecimals ( )

Definition at line 84 of file class.ilADTFloatDefinition.php.

References $decimals.

84  : int
85  {
86  return $this->decimals;
87  }

◆ getMax()

ilADTFloatDefinition::getMax ( )

Definition at line 52 of file class.ilADTFloatDefinition.php.

References $max_value.

52  : ?float
53  {
54  return $this->max_value;
55  }

◆ getMin()

ilADTFloatDefinition::getMin ( )

Definition at line 42 of file class.ilADTFloatDefinition.php.

References $min_value.

42  : ?float
43  {
44  return $this->min_value;
45  }

◆ getSuffix()

ilADTFloatDefinition::getSuffix ( )

Definition at line 62 of file class.ilADTFloatDefinition.php.

References $suffix.

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

◆ handleNumber()

ilADTFloatDefinition::handleNumber (   $a_value)

Definition at line 30 of file class.ilADTFloatDefinition.php.

References null.

Referenced by setMax(), and setMin().

30  : ?float
31  {
32  if (!is_numeric($a_value)) {
33  $a_value = null;
34  }
35  if ($a_value !== null) {
36  // round?
37  $a_value = (float) $a_value;
38  }
39  return $a_value;
40  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ isComparableTo()

ilADTFloatDefinition::isComparableTo ( ilADT  $a_adt)

Definition at line 72 of file class.ilADTFloatDefinition.php.

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

◆ reset()

ilADTFloatDefinition::reset ( )

Definition at line 78 of file class.ilADTFloatDefinition.php.

References setDecimals().

78  : void
79  {
80  parent::reset();
81  $this->setDecimals(1);
82  }
+ Here is the call graph for this function:

◆ setDecimals()

ilADTFloatDefinition::setDecimals ( int  $a_value)

Definition at line 89 of file class.ilADTFloatDefinition.php.

Referenced by reset().

89  : void
90  {
91  // max precision ?!
92  $this->decimals = max(1, abs($a_value));
93  }
+ Here is the caller graph for this function:

◆ setMax()

ilADTFloatDefinition::setMax ( ?float  $a_value)

Definition at line 57 of file class.ilADTFloatDefinition.php.

References handleNumber().

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

◆ setMin()

ilADTFloatDefinition::setMin ( ?float  $a_value)

Definition at line 47 of file class.ilADTFloatDefinition.php.

References handleNumber().

47  : void
48  {
49  $this->min_value = $this->handleNumber($a_value);
50  }
+ Here is the call graph for this function:

◆ setSuffix()

ilADTFloatDefinition::setSuffix ( ?string  $a_value)

Definition at line 67 of file class.ilADTFloatDefinition.php.

References null.

67  : void
68  {
69  $this->suffix = $a_value === null ? '' : trim($a_value);
70  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Field Documentation

◆ $decimals

int ilADTFloatDefinition::$decimals
protected

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

Referenced by getDecimals().

◆ $max_value

float ilADTFloatDefinition::$max_value
protected

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

Referenced by getMax().

◆ $min_value

float ilADTFloatDefinition::$min_value
protected

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

Referenced by getMin().

◆ $suffix

string ilADTFloatDefinition::$suffix = ''
protected

Definition at line 26 of file class.ilADTFloatDefinition.php.

Referenced by getSuffix().


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