ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilADTDateSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTDateSearchBridgeSingle:
+ Collaboration diagram for ilADTDateSearchBridgeSingle:

Public Member Functions

 loadFilter ()
 
 addToForm ()
 
 importFromPost (array $a_post=null)
 
 getSQLCondition ($a_element_id)
 
 isInCondition (ilADT $a_adt)
 
 getSerializedValue ()
 
 setSerializedValue ($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)
 Constructor. More...
 
 isNull ()
 Is null ? More...
 
 setForm (ilPropertyFormGUI $a_form)
 Set form. More...
 
 getForm ()
 Get form. More...
 
 setElementId ($a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 Get element id. More...
 
 setTitle ($a_value)
 Set title (aka form field caption) More...
 
 getTitle ()
 Get title. More...
 
 setTableGUI (ilTable2GUI $a_table)
 Set table gui (for filter mode) More...
 
 getTableGUI ()
 Get table gui. More...
 
 loadFilter ()
 Load filter value(s) into ADT. More...
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 importFromPost (array $a_post=null)
 Import values from (search) form request POST data. More...
 
 validate ()
 Validate current data. More...
 
 getSQLCondition ($a_element_id)
 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 ($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)
 Check if given ADT definition is valid. More...
 
 setDefinition (ilADTDefinition $a_adt_def)
 Set ADT definition. More...
 
 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 ($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

- Protected Attributes inherited from ilADTSearchBridgeSingle
 $adt
 
- Protected Attributes inherited from ilADTSearchBridge
 $form
 
 $table_gui
 
 $table_filter_fields = []
 
 $id
 
 $title
 
 $info
 

Detailed Description

Definition at line 5 of file class.ilADTDateSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTDateSearchBridgeSingle::addToForm ( )

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

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

27  {
28  $adt_date = $this->getADT()->getDate();
29 
30  $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId());
31  $date->setShowTime(false);
32 
33  $date->setDate($adt_date);
34 
35  $this->addToParentElement($date);
36  }
This class represents a date/time property in a property form.
getElementId()
Get element id.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
+ Here is the call graph for this function:

◆ getSerializedValue()

ilADTDateSearchBridgeSingle::getSerializedValue ( )

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

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

94  {
95  if (!$this->isNull() && $this->isValid()) {
96  return serialize(array($this->getADT()->getDate()->get(IL_CAL_DATE)));
97  }
98  }
const IL_CAL_DATE
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTDateSearchBridgeSingle::getSQLCondition (   $a_element_id)

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

References $DIC, $ilDB, ilADTSearchBridgeSingle\getADT(), IL_CAL_DATE, ilADTSearchBridgeSingle\isNull(), and ilADTSearchBridgeSingle\isValid().

73  {
74  global $DIC;
75 
76  $ilDB = $DIC['ilDB'];
77 
78  if (!$this->isNull() && $this->isValid()) {
79  return $a_element_id . " = " . $ilDB->quote($this->getADT()->getDate()->get(IL_CAL_DATE), "date");
80  }
81  }
global $DIC
Definition: saml.php:7
const IL_CAL_DATE
global $ilDB
+ Here is the call graph for this function:

◆ importFromPost()

ilADTDateSearchBridgeSingle::importFromPost ( array  $a_post = null)

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

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

47  {
48  $post = $this->extractPostValues($a_post);
49 
50  if ($post && $this->shouldBeImportedFromPost($post)) {
51  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
53 
54  if ($this->getForm() instanceof ilPropertyFormGUI) {
55  $item = $this->getForm()->getItemByPostVar($this->getElementId());
56  $item->setDate($date);
57  } elseif (array_key_exists($this->getElementId(), $this->table_filter_fields)) {
58  $this->table_filter_fields[$this->getElementId()]->setDate($date);
59  $this->writeFilter($date->get(IL_CAL_DATE));
60  }
61 
62  $this->getADT()->setDate($date);
63  } else {
64  $this->writeFilter();
65  $this->getADT()->setDate();
66  }
67  }
This class represents a property form user interface.
extractPostValues(array $a_post=null)
Extract data from (post) values.
$post
Definition: post.php:34
const IL_CAL_DATE
writeFilter($a_value=null)
Write value(s) to filter store (in session)
getElementId()
Get element id.
static parseIncomingDate($a_value, $a_add_time=null)
Try to parse incoming value to date object.
+ Here is the call graph for this function:

◆ isInCondition()

ilADTDateSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

Definition at line 83 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

84  {
85  assert($a_adt instanceof ilADTDate);
86 
87  return $this->getADT()->equals($a_adt);
88  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTDateSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

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

8  {
9  return ($a_adt_def instanceof ilADTDateDefinition);
10  }

◆ loadFilter()

ilADTDateSearchBridgeSingle::loadFilter ( )

Definition at line 15 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridge\readFilter().

16  {
17  $value = $this->readFilter();
18  if ($value !== null) {
19  // $this->getADT()->setDate(new ilDate($value, IL_CAL_DATE));
20  }
21  }
readFilter()
Load value(s) from filter store (in session)
+ Here is the call graph for this function:

◆ setSerializedValue()

ilADTDateSearchBridgeSingle::setSerializedValue (   $a_value)

Definition at line 100 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), and IL_CAL_DATE.

101  {
102  $a_value = unserialize($a_value);
103  if (is_array($a_value)) {
104  $this->getADT()->setDate(new ilDate($a_value[0], IL_CAL_DATE));
105  }
106  }
Class for single dates.
const IL_CAL_DATE
+ Here is the call graph for this function:

◆ shouldBeImportedFromPost()

ilADTDateSearchBridgeSingle::shouldBeImportedFromPost (   $a_post)
protected

Definition at line 38 of file class.ilADTDateSearchBridgeSingle.php.

Referenced by importFromPost().

39  {
40  if (!(bool) $this->text_input) {
41  return (bool) $a_post["tgl"];
42  }
43  return parent::shouldBeImportedFromPost($a_post);
44  }
+ Here is the caller graph for this function:

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