ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilADTFloatSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTFloatSearchBridgeSingle:
+ Collaboration diagram for ilADTFloatSearchBridgeSingle:

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)
 
- 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.ilADTFloatSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTFloatSearchBridgeSingle::addToForm ( )

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

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

28  {
29  $def = $this->getADT()->getCopyOfDefinition();
30 
31  $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
32  $number->setSize(10);
33  $number->setDecimals($def->getDecimals());
34 
35  $min = $def->getMin();
36  if($min !== null)
37  {
38  $number->setMinValue($min);
39  }
40 
41  $max = $def->getMax();
42  if($max !== null)
43  {
44  $number->setMaxValue($max);
45 
46  $length = strlen($max);
47  $number->setSize($length);
48  $number->setMaxLength($length);
49  }
50 
51  $number->setValue($this->getADT()->getNumber());
52 
53  $this->addToParentElement($number);
54  }
This class represents a number 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()

ilADTFloatSearchBridgeSingle::getSerializedValue ( )

Definition at line 96 of file class.ilADTFloatSearchBridgeSingle.php.

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

97  {
98  if(!$this->isNull() && $this->isValid())
99  {
100  return serialize(array($this->getADT()->getNumber()));
101  }
102  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTFloatSearchBridgeSingle::getSQLCondition (   $a_element_id)

Definition at line 76 of file class.ilADTFloatSearchBridgeSingle.php.

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

77  {
78  global $ilDB;
79 
80  if(!$this->isNull() && $this->isValid())
81  {
82  return $a_element_id." = ".$ilDB->quote($this->getADT()->getNumber(), "float");
83  }
84  }
global $ilDB
+ Here is the call graph for this function:

◆ importFromPost()

ilADTFloatSearchBridgeSingle::importFromPost ( array  $a_post = null)

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

References ilADTSearchBridge\extractPostValues(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), ilADTSearchBridge\getForm(), and ilADTSearchBridge\shouldBeImportedFromPost().

57  {
58  $post = $this->extractPostValues($a_post);
59 
60  if($post && $this->shouldBeImportedFromPost($post))
61  {
62  $item = $this->getForm()->getItemByPostVar($this->getElementId());
63  $item->setValue($post);
64 
65  $this->getADT()->setNumber($post);
66  }
67  else
68  {
69  $this->getADT()->setNumber();
70  }
71  }
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ isInCondition()

ilADTFloatSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

Definition at line 86 of file class.ilADTFloatSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

87  {
88  assert($a_adt instanceof ilADTFloat);
89 
90  return $this->getADT()->equals($a_adt);
91  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTFloatSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

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

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

◆ loadFilter()

ilADTFloatSearchBridgeSingle::loadFilter ( )

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

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

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

◆ setSerializedValue()

ilADTFloatSearchBridgeSingle::setSerializedValue (   $a_value)

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

References ilADTSearchBridgeSingle\getADT().

105  {
106  $a_value = unserialize($a_value);
107  if(is_array($a_value))
108  {
109  $this->getADT()->setNumber($a_value[0]);
110  }
111  }
+ Here is the call graph for this function:

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