ILIAS  release_8 Revision v8.24
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 5 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 36 of file class.ilADTBoolean.php.

36 : ?bool
37 {
38 if ($this->getDefinition()->isComparableTo($a_adt)) {
39 return ($this->getStatus() === $a_adt->getStatus());
40 }
41 return null;
42 }
getDefinition()
Get definition.
Definition: class.ilADT.php:92

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 78 of file class.ilADTBoolean.php.

78 : ?stdClass
79 {
80 if (!$this->isNull()) {
81 $obj = new stdClass();
82 $obj->value = $this->getStatus();
83 return $obj;
84 }
85 return null;
86 }
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 68 of file class.ilADTBoolean.php.

68 : ?string
69 {
70 if (!$this->isNull()) {
71 return (string) $this->getStatus();
72 }
73 return null;
74 }

References getStatus(), and isNull().

+ Here is the call graph for this function:

◆ getStatus()

ilADTBoolean::getStatus ( )

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

29 : ?bool
30 {
31 return $this->value;
32 }

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 88 of file class.ilADTBoolean.php.

88 : void
89 {
90 if (is_object($a_std)) {
91 $this->setStatus((bool) $a_std->value);
92 }
93 }
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 44 of file class.ilADTBoolean.php.

44 : ?bool
45 {
46 return null;
47 }

◆ isNull()

ilADTBoolean::isNull ( )

Is currently null.

Returns
bool | null

Reimplemented from ilADT.

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

56 : bool
57 {
58 return $this->getStatus() === null;
59 }

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 49 of file class.ilADTBoolean.php.

49 : ?bool
50 {
51 return null;
52 }

◆ isValid()

ilADTBoolean::isValid ( )

Reimplemented from ilADT.

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

61 : bool
62 {
63 return true;
64 }

◆ 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 11 of file class.ilADTBoolean.php.

11 : bool
12 {
13 return ($a_def instanceof ilADTBooleanDefinition);
14 }
Class ilADTBooleanDefinition.

◆ reset()

ilADTBoolean::reset ( )

Init property defaults.

Reimplemented from ilADT.

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

16 : void
17 {
18 parent::reset();
19 $this->value = null;
20 }

◆ setStatus()

ilADTBoolean::setStatus ( bool  $a_value = null)

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

24 : void
25 {
26 $this->value = $a_value;
27 }

Referenced by importStdClass().

+ Here is the caller graph for this function:

Field Documentation

◆ $value

bool ilADTBoolean::$value
protected

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

Referenced by getStatus().


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