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

Public Member Functions

 reset ()
 Init property defaults. More...
 
 setStatus (?bool $a_value=null)
 
 getStatus ()
 
 equals (ilADT $a_adt)
 Check if given ADT equals self. More...
 
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self. More...
 
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self. More...
 
 isNull ()
 Is currently null. More...
 
 isValid ()
 
 getCheckSum ()
 Get unique checksum. More...
 
 exportStdClass ()
 Export value as stdClass. More...
 
 importStdClass (?stdClass $a_std)
 Import value from stdClass. More...
 
- Public Member Functions inherited from ilADT
 __construct (ilADTDefinition $a_def)
 
 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 getCopyOfDefinition ()
 Get copy of definition. More...
 
 equals (ilADT $a_adt)
 Check if given ADT equals self. More...
 
 isLarger (ilADT $a_adt)
 Check if given ADT is larger than self. More...
 
 isLargerOrEqual (ilADT $a_adt)
 
 isSmaller (ilADT $a_adt)
 Check if given ADT is smaller than self. More...
 
 isSmallerOrEqual (ilADT $a_adt)
 Check if given ADT is smaller or equal than self. More...
 
 isInbetween (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (exclusive) More...
 
 isInbetweenOrEqual (ilADT $a_adt_from, ilADT $a_adt_to)
 Check if self is inbetween given ADTs (inclusive) More...
 
 isNull ()
 Is currently null. More...
 
 isValid ()
 
 getValidationErrors ()
 Get all validation error codes. More...
 
 translateErrorCode (string $a_code)
 Translate error-code to human-readable message. More...
 
 getCheckSum ()
 Get unique checksum. More...
 
 exportStdClass ()
 Export value as stdClass. More...
 
 importStdClass (?stdClass $a_std)
 Import value from stdClass. More...
 

Protected Member Functions

 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT. More...
 
- Protected Member Functions inherited from ilADT
 isValidDefinition (ilADTDefinition $a_def)
 Check if definition is valid for ADT. More...
 
 setDefinition (ilADTDefinition $a_def)
 Set definition. More...
 
 getDefinition ()
 Get definition. More...
 
 addValidationError (string $a_error_code)
 

Protected Attributes

bool $value
 
- Protected Attributes inherited from ilADT
ilADTDefinition $definition
 
ilLanguage $lng
 
array $validation_errors = []
 

Additional Inherited Members

- Data Fields inherited from ilADT
const ADT_VALIDATION_ERROR_NULL_NOT_ALLOWED = "adt1"
 
const ADT_VALIDATION_ERROR_MAX_LENGTH = "adt2"
 
const ADT_VALIDATION_ERROR_MAX_SIZE = "adt3"
 
const ADT_VALIDATION_ERROR_MIN = "adt4"
 
const ADT_VALIDATION_ERROR_MAX = "adt5"
 
const ADT_VALIDATION_DATE = "adt6"
 
const ADT_VALIDATION_ERROR_INVALID_NODE = 'adt7'
 

Detailed Description

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

Member Function Documentation

◆ equals()

ilADTBoolean::equals ( ilADT  $a_adt)

Check if given ADT equals self.

Parameters
ilADT$a_adt
Returns
bool|null

Reimplemented from ilADT.

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

52 : ?bool
53 {
54 if ($this->getDefinition()->isComparableTo($a_adt)) {
55 return ($this->getStatus() === $a_adt->getStatus());
56 }
57 return null;
58 }
getDefinition()
Get definition.

References ilADT\getDefinition(), and getStatus().

+ Here is the call graph for this function:

◆ exportStdClass()

ilADTBoolean::exportStdClass ( )

Export value as stdClass.

Returns
stdClass | null

Reimplemented from ilADT.

Definition at line 94 of file class.ilADTBoolean.php.

94 : ?stdClass
95 {
96 if (!$this->isNull()) {
97 $obj = new stdClass();
98 $obj->value = $this->getStatus();
99 return $obj;
100 }
101 return null;
102 }
isNull()
Is currently null.

References getStatus(), and isNull().

+ Here is the call graph for this function:

◆ getCheckSum()

ilADTBoolean::getCheckSum ( )

Get unique checksum.

Returns
string | null

Reimplemented from ilADT.

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

84 : ?string
85 {
86 if (!$this->isNull()) {
87 return (string) $this->getStatus();
88 }
89 return null;
90 }

References getStatus(), and isNull().

+ Here is the call graph for this function:

◆ getStatus()

ilADTBoolean::getStatus ( )

Definition at line 45 of file class.ilADTBoolean.php.

45 : ?bool
46 {
47 return $this->value;
48 }

References $value.

Referenced by equals(), exportStdClass(), getCheckSum(), and isNull().

+ Here is the caller graph for this function:

◆ importStdClass()

ilADTBoolean::importStdClass ( ?stdClass  $a_std)

Import value from stdClass.

Parameters
stdClass  |  null$a_std

Reimplemented from ilADT.

Definition at line 104 of file class.ilADTBoolean.php.

104 : void
105 {
106 if (is_object($a_std)) {
107 $this->setStatus((bool) $a_std->value);
108 }
109 }
setStatus(?bool $a_value=null)

References setStatus().

+ Here is the call graph for this function:

◆ isLarger()

ilADTBoolean::isLarger ( ilADT  $a_adt)

Check if given ADT is larger than self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADT.

Definition at line 60 of file class.ilADTBoolean.php.

60 : ?bool
61 {
62 return null;
63 }

◆ isNull()

ilADTBoolean::isNull ( )

Is currently null.

Returns
bool | null

Reimplemented from ilADT.

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

72 : bool
73 {
74 return $this->getStatus() === null;
75 }

References getStatus().

Referenced by exportStdClass(), and getCheckSum().

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

◆ isSmaller()

ilADTBoolean::isSmaller ( ilADT  $a_adt)

Check if given ADT is smaller than self.

Parameters
ilADT$a_adt
Returns
bool | null

Reimplemented from ilADT.

Definition at line 65 of file class.ilADTBoolean.php.

65 : ?bool
66 {
67 return null;
68 }

◆ isValid()

ilADTBoolean::isValid ( )

Reimplemented from ilADT.

Definition at line 77 of file class.ilADTBoolean.php.

77 : bool
78 {
79 return true;
80 }

◆ isValidDefinition()

ilADTBoolean::isValidDefinition ( ilADTDefinition  $a_def)
protected

Check if definition is valid for ADT.

Parameters
ilADTDefinition$a_def
Returns
bool

Reimplemented from ilADT.

Definition at line 27 of file class.ilADTBoolean.php.

27 : bool
28 {
29 return ($a_def instanceof ilADTBooleanDefinition);
30 }
Class ilADTBooleanDefinition.

◆ reset()

ilADTBoolean::reset ( )

Init property defaults.

Reimplemented from ilADT.

Definition at line 32 of file class.ilADTBoolean.php.

32 : void
33 {
34 parent::reset();
35 $this->value = null;
36 }

◆ setStatus()

ilADTBoolean::setStatus ( ?bool  $a_value = null)

Definition at line 40 of file class.ilADTBoolean.php.

40 : void
41 {
42 $this->value = $a_value;
43 }

Referenced by importStdClass().

+ Here is the caller graph for this function:

Field Documentation

◆ $value

bool ilADTBoolean::$value
protected

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

Referenced by getStatus().


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