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

Public Member Functions

 loadFilter ()
 
 addToForm ()
 
 importFromPost (?array $a_post=null)
 
 getSQLCondition (string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
 
 isInCondition (ilADT $a_adt)
 
 getSerializedValue ()
 
 setSerializedValue (string $a_value)
 
- Public Member Functions inherited from ilADTSearchBridgeSingle
 getADT ()
 Get ADT. More...
 
 isNull ()
 
 isValid ()
 
 validate ()
 
- Public Member Functions inherited from ilADTSearchBridge
 __construct (ilADTDefinition $a_adt_def)
 
 isNull ()
 
 setForm (ilPropertyFormGUI $a_form)
 
 getForm ()
 
 setElementId (string $a_value)
 
 getElementId ()
 
 setTitle (string $a_value)
 
 getTitle ()
 
 getSearchColumn ()
 
 setTableGUI (ilTable2GUI $a_table)
 
 getTableGUI ()
 Get table gui. More...
 
 loadFilter ()
 Load filter value(s) into ADT. More...
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 addToFilterForm ()
 Add ADT-specific fields to filter. More...
 
 importFromPost (?array $a_post=null)
 
 validate ()
 Validate current data. More...
 
 getSQLCondition (string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
 Get SQL condition for current value(s) More...
 
 isInCondition (ilADT $a_adt)
 Compare directly against ADT. More...
 
 getSerializedValue ()
 Get current value(s) in serialized form (for easy persisting) More...
 
 setSerializedValue (string $a_value)
 Set current value(s) in serialized form (for easy persisting) More...
 

Protected Member Functions

 isValidADTDefinition (ilADTDefinition $a_adt_def)
 
 shouldBeImportedFromPost ($a_post)
 
- Protected Member Functions inherited from ilADTSearchBridgeSingle
 setDefinition (ilADTDefinition $a_adt_def)
 
- Protected Member Functions inherited from ilADTSearchBridge
 isValidADTDefinition (ilADTDefinition $a_adt_def)
 
 setDefinition (ilADTDefinition $a_adt_def)
 
 writeFilter ($a_value=null)
 Write value(s) to filter store (in session) More...
 
 readFilter ()
 Load value(s) from filter store (in session) More...
 
 addToParentElement (ilFormPropertyGUI $a_field)
 Add form field to parent element. More...
 
 addToElementId (string $a_add)
 Add sub-element. More...
 
 shouldBeImportedFromPost ($a_post)
 Check if incoming values should be imported at all. More...
 
 extractPostValues (?array $a_post=null)
 Extract data from (post) values. More...
 

Additional Inherited Members

- Data Fields inherited from ilADTSearchBridge
const SQL_STRICT = 1
 
const SQL_LIKE = 2
 
const SQL_LIKE_END = 3
 
const SQL_LIKE_START = 4
 
const DEFAULT_SEARCH_COLUMN = 'value'
 
- Protected Attributes inherited from ilADTSearchBridgeSingle
ilADT $adt
 
- Protected Attributes inherited from ilADTSearchBridge
ilPropertyFormGUI $form = null
 
ilTable2GUI $table_gui = null
 
array $table_filter_fields = []
 
string $id = ''
 
string $title = ''
 
string $info = ''
 
ilLanguage $lng
 
ilDBInterface $db
 
HttpServices $http
 

Detailed Description

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

Member Function Documentation

◆ addToForm()

ilADTDateTimeSearchBridgeSingle::addToForm ( )

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

References ilADTSearchBridge\addToParentElement(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), and ilADTSearchBridge\getTitle().

40  : void
41  {
42  $adt_date = $this->getADT()->getDate();
43 
44  $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId());
45  $date->setShowTime(true);
46 
47  $date->setDate($adt_date);
48 
49  $this->addToParentElement($date);
50  }
This class represents a date/time property in a property form.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
+ Here is the call graph for this function:

◆ getSerializedValue()

ilADTDateTimeSearchBridgeSingle::getSerializedValue ( )

Definition at line 102 of file class.ilADTDateTimeSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), IL_CAL_DATETIME, ilADTSearchBridgeSingle\isNull(), and ilADTSearchBridgeSingle\isValid().

102  : string
103  {
104  if (!$this->isNull() && $this->isValid()) {
105  return serialize(array($this->getADT()->getDate()->get(IL_CAL_DATETIME)));
106  }
107  return '';
108  }
const IL_CAL_DATETIME
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTDateTimeSearchBridgeSingle::getSQLCondition ( string  $a_element_id,
int  $mode = self::SQL_LIKE,
array  $quotedWords = [] 
)

Definition at line 85 of file class.ilADTDateTimeSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), IL_CAL_DATETIME, ilADTSearchBridgeSingle\isNull(), and ilADTSearchBridgeSingle\isValid().

85  : string
86  {
87  if (!$this->isNull() && $this->isValid()) {
88  return $a_element_id . " = " . $this->db->quote($this->getADT()->getDate()->get(IL_CAL_DATETIME), "timestamp");
89  }
90  return '';
91  }
const IL_CAL_DATETIME
+ Here is the call graph for this function:

◆ importFromPost()

ilADTDateTimeSearchBridgeSingle::importFromPost ( ?array  $a_post = null)

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

References $post, ilADTSearchBridge\extractPostValues(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), ilADTSearchBridge\getForm(), IL_CAL_DATETIME, ilCalendarUtil\parseIncomingDate(), shouldBeImportedFromPost(), and ilADTSearchBridge\writeFilter().

60  : bool
61  {
62  $post = $this->extractPostValues($a_post);
63 
64  if ($post && $this->shouldBeImportedFromPost($post)) {
66 
67  if ($this->getForm() instanceof ilPropertyFormGUI) {
68  $item = $this->getForm()->getItemByPostVar($this->getElementId());
69  $item->setDate($date);
70  } elseif (array_key_exists($this->getElementId(), $this->table_filter_fields)) {
71  $this->table_filter_fields[$this->getElementId()]->setDate($date);
72  $this->writeFilter($date->get(IL_CAL_DATETIME));
73  }
74 
75  $this->getADT()->setDate($date);
76  } else {
77  $this->writeFilter();
78  $this->getADT()->setDate();
79  }
80  return true;
81  }
static parseIncomingDate($value, bool $add_time=false)
Try to parse incoming value to date object.
const IL_CAL_DATETIME
extractPostValues(?array $a_post=null)
Extract data from (post) values.
writeFilter($a_value=null)
Write value(s) to filter store (in session)
$post
Definition: ltitoken.php:46
+ Here is the call graph for this function:

◆ isInCondition()

ilADTDateTimeSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

Definition at line 93 of file class.ilADTDateTimeSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

93  : bool
94  {
95  assert($a_adt instanceof ilADTDateTime);
96 
97  return $this->getADT()->equals($a_adt);
98  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTDateTimeSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

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

23  : bool
24  {
25  return ($a_adt_def instanceof ilADTDateTimeDefinition);
26  }

◆ loadFilter()

ilADTDateTimeSearchBridgeSingle::loadFilter ( )

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

References ilADTSearchBridgeSingle\getADT(), IL_CAL_DATETIME, null, and ilADTSearchBridge\readFilter().

30  : void
31  {
32  $value = $this->readFilter();
33  if ($value !== null) {
34  $this->getADT()->setDate(new ilDateTime($value, IL_CAL_DATETIME));
35  }
36  }
const IL_CAL_DATETIME
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readFilter()
Load value(s) from filter store (in session)
+ Here is the call graph for this function:

◆ setSerializedValue()

ilADTDateTimeSearchBridgeSingle::setSerializedValue ( string  $a_value)

Definition at line 110 of file class.ilADTDateTimeSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), and IL_CAL_DATETIME.

110  : void
111  {
112  $a_value = unserialize($a_value);
113  if (is_array($a_value)) {
114  $this->getADT()->setDate(new ilDateTime($a_value[0], IL_CAL_DATETIME));
115  }
116  }
const IL_CAL_DATETIME
+ Here is the call graph for this function:

◆ shouldBeImportedFromPost()

ilADTDateTimeSearchBridgeSingle::shouldBeImportedFromPost (   $a_post)
protected

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

Referenced by importFromPost().

55  : bool
56  {
57  return ($a_post['lower'] ?? false) || ($a_post['upper'] ?? false);
58  }
+ Here is the caller graph for this function:

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