ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 5 of file class.ilADTFloatDefinition.php.

Member Function Documentation

◆ getDecimals()

ilADTFloatDefinition::getDecimals ( )

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

References $decimals.

68  : int
69  {
70  return $this->decimals;
71  }

◆ getMax()

ilADTFloatDefinition::getMax ( )

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

References $max_value.

36  : ?float
37  {
38  return $this->max_value;
39  }

◆ getMin()

ilADTFloatDefinition::getMin ( )

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

References $min_value.

26  : ?float
27  {
28  return $this->min_value;
29  }

◆ getSuffix()

ilADTFloatDefinition::getSuffix ( )

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

References $suffix.

46  : string
47  {
48  return $this->suffix;
49  }

◆ handleNumber()

ilADTFloatDefinition::handleNumber (   $a_value)

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

Referenced by setMax(), and setMin().

14  : ?float
15  {
16  if (!is_numeric($a_value)) {
17  $a_value = null;
18  }
19  if ($a_value !== null) {
20  // round?
21  $a_value = (float) $a_value;
22  }
23  return $a_value;
24  }
+ Here is the caller graph for this function:

◆ isComparableTo()

ilADTFloatDefinition::isComparableTo ( ilADT  $a_adt)

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

56  : bool
57  {
58  // has to be number-based
59  return ($a_adt instanceof ilADTFloat);
60  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ reset()

ilADTFloatDefinition::reset ( )

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

References setDecimals().

62  : void
63  {
64  parent::reset();
65  $this->setDecimals(1);
66  }
+ Here is the call graph for this function:

◆ setDecimals()

ilADTFloatDefinition::setDecimals ( int  $a_value)

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

Referenced by reset().

73  : void
74  {
75  // max precision ?!
76  $this->decimals = max(1, abs($a_value));
77  }
+ Here is the caller graph for this function:

◆ setMax()

ilADTFloatDefinition::setMax ( ?float  $a_value)

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

References handleNumber().

41  : void
42  {
43  $this->max_value = $this->handleNumber($a_value);
44  }
+ Here is the call graph for this function:

◆ setMin()

ilADTFloatDefinition::setMin ( ?float  $a_value)

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

References handleNumber().

31  : void
32  {
33  $this->min_value = $this->handleNumber($a_value);
34  }
+ Here is the call graph for this function:

◆ setSuffix()

ilADTFloatDefinition::setSuffix ( ?string  $a_value)

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

51  : void
52  {
53  $this->suffix = $a_value === null ? '' : trim($a_value);
54  }

Field Documentation

◆ $decimals

int ilADTFloatDefinition::$decimals
protected

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

Referenced by getDecimals().

◆ $max_value

float ilADTFloatDefinition::$max_value
protected

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

Referenced by getMax().

◆ $min_value

float ilADTFloatDefinition::$min_value
protected

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

Referenced by getMin().

◆ $suffix

string ilADTFloatDefinition::$suffix = ''
protected

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

Referenced by getSuffix().


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