ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADTDateTime Class Reference
+ Inheritance diagram for ilADTDateTime:
+ Collaboration diagram for ilADTDateTime:

Public Member Functions

 reset ()
 
 setDate (?ilDateTime $a_value=null)
 
 getDate ()
 
 equals (ilADT $a_adt)
 
 isLarger (ilADT $a_adt)
 
 isSmaller (ilADT $a_adt)
 
 isNull ()
 
 getCheckSum ()
 
 exportStdClass ()
 
 importStdClass (?stdClass $a_std)
 
- 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)
 
- 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

ilDateTime $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.ilADTDateTime.php.

Member Function Documentation

◆ equals()

ilADTDateTime::equals ( ilADT  $a_adt)

Definition at line 55 of file class.ilADTDateTime.php.

References getDate(), ilADT\getDefinition(), IL_CAL_UNIX, isNull(), ilADT\isNull(), and null.

55  : ?bool
56  {
57  if ($this->getDefinition()->isComparableTo($a_adt)) {
58  if (!$this->isNull() && !$a_adt->isNull()) {
59  // could use checksum...
60  $value = $this->getDate()->get(IL_CAL_UNIX);
61  $other = $a_adt->getDate()->get(IL_CAL_UNIX);
62  return ($value == $other);
63  }
64  }
65  return null;
66  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isNull()
Is currently null.
getDefinition()
Get definition.
+ Here is the call graph for this function:

◆ exportStdClass()

ilADTDateTime::exportStdClass ( )

Definition at line 109 of file class.ilADTDateTime.php.

References getDate(), IL_CAL_UNIX, isNull(), and null.

109  : ?stdClass
110  {
111  if (!$this->isNull()) {
112  $obj = new stdClass();
113  $obj->value = $this->getDate()->get(IL_CAL_UNIX);
114  return $obj;
115  }
116  return null;
117  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getCheckSum()

ilADTDateTime::getCheckSum ( )

Definition at line 99 of file class.ilADTDateTime.php.

References getDate(), IL_CAL_UNIX, isNull(), and null.

99  : ?string
100  {
101  if (!$this->isNull()) {
102  return (string) $this->getDate()->get(IL_CAL_UNIX);
103  }
104  return null;
105  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getDate()

ilADTDateTime::getDate ( )

Definition at line 48 of file class.ilADTDateTime.php.

References $value.

Referenced by equals(), exportStdClass(), getCheckSum(), isLarger(), and isSmaller().

48  : ?ilDateTime
49  {
50  return $this->value;
51  }
+ Here is the caller graph for this function:

◆ importStdClass()

ilADTDateTime::importStdClass ( ?stdClass  $a_std)

Definition at line 119 of file class.ilADTDateTime.php.

References IL_CAL_UNIX, and setDate().

119  : void
120  {
121  if (is_object($a_std)) {
122  $this->setDate(new ilDateTime($a_std->value, IL_CAL_UNIX));
123  }
124  }
const IL_CAL_UNIX
setDate(?ilDateTime $a_value=null)
+ Here is the call graph for this function:

◆ isLarger()

ilADTDateTime::isLarger ( ilADT  $a_adt)

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

References getDate(), ilADT\getDefinition(), IL_CAL_UNIX, isNull(), ilADT\isNull(), and null.

68  : ?bool
69  {
70  if ($this->getDefinition()->isComparableTo($a_adt)) {
71  if (!$this->isNull() && !$a_adt->isNull()) {
72  $value = $this->getDate()->get(IL_CAL_UNIX);
73  $other = $a_adt->getDate()->get(IL_CAL_UNIX);
74  return ($value > $other);
75  }
76  }
77  return null;
78  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isNull()
Is currently null.
getDefinition()
Get definition.
+ Here is the call graph for this function:

◆ isNull()

ilADTDateTime::isNull ( )

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

Referenced by equals(), exportStdClass(), getCheckSum(), isLarger(), and isSmaller().

94  : bool
95  {
96  return !$this->value instanceof ilDateTime || $this->value->isNull();
97  }
+ Here is the caller graph for this function:

◆ isSmaller()

ilADTDateTime::isSmaller ( ilADT  $a_adt)

Definition at line 80 of file class.ilADTDateTime.php.

References getDate(), ilADT\getDefinition(), IL_CAL_UNIX, isNull(), ilADT\isNull(), and null.

80  : ?bool
81  {
82  if ($this->getDefinition()->isComparableTo($a_adt)) {
83  if (!$this->isNull() && !$a_adt->isNull()) {
84  $value = $this->getDate()->get(IL_CAL_UNIX);
85  $other = $a_adt->getDate()->get(IL_CAL_UNIX);
86  return ($value < $other);
87  }
88  }
89  return null;
90  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isNull()
Is currently null.
getDefinition()
Get definition.
+ Here is the call graph for this function:

◆ isValidDefinition()

ilADTDateTime::isValidDefinition ( ilADTDefinition  $a_def)
protected

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

27  : bool
28  {
29  return $a_def instanceof ilADTDateTimeDefinition;
30  }

◆ reset()

ilADTDateTime::reset ( )

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

References null.

32  : void
33  {
34  parent::reset();
35  $this->value = null;
36  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ setDate()

ilADTDateTime::setDate ( ?ilDateTime  $a_value = null)

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

References null.

Referenced by importStdClass().

41  {
42  if ($a_value && $a_value->isNull()) {
43  $a_value = null;
44  }
45  $this->value = $a_value;
46  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

Field Documentation

◆ $value

ilDateTime ilADTDateTime::$value
protected

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

Referenced by getDate().


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