ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilADTFloatSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTFloatSearchBridgeSingle:
+ Collaboration diagram for ilADTFloatSearchBridgeSingle:

Public Member Functions

 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...
 
 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...
 
- Public Member Functions inherited from ilADTSearchBridgeSingle
 getADT ()
 Get ADT. More...
 
 isNull ()
 Is null ? More...
 
 isValid ()
 
 validate ()
 Validate current data. More...
 
- 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)
 Check if given ADT definition is valid. More...
 
- Protected Member Functions inherited from ilADTSearchBridgeSingle
 setDefinition (ilADTDefinition $a_adt_def)
 Set ADT definition. More...
 
- 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 ( )

Add ADT-specific fields to form.

Reimplemented from ilADTSearchBridge.

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

27 {
28 $def = $this->getADT()->getCopyOfDefinition();
29
30 $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
31 $number->setSize(10);
32 $number->setDecimals($def->getDecimals());
33
34 $min = $def->getMin();
35 if ($min !== null) {
36 $number->setMinValue($min);
37 }
38
39 $max = $def->getMax();
40 if ($max !== null) {
41 $number->setMaxValue($max);
42
43 $length = strlen($max);
44 $number->setSize($length);
45 $number->setMaxLength($length);
46 }
47
48 $number->setValue($this->getADT()->getNumber());
49
50 $this->addToParentElement($number);
51 }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
getElementId()
Get element id.
This class represents a number property in a property form.

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

+ Here is the call graph for this function:

◆ getSerializedValue()

ilADTFloatSearchBridgeSingle::getSerializedValue ( )

Get current value(s) in serialized form (for easy persisting)

Returns
string

Reimplemented from ilADTSearchBridge.

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

92 {
93 if (!$this->isNull() && $this->isValid()) {
94 return serialize(array($this->getADT()->getNumber()));
95 }
96 }

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

+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTFloatSearchBridgeSingle::getSQLCondition (   $a_element_id)

Get SQL condition for current value(s)

Parameters
string$a_element_id
Returns
string

Reimplemented from ilADTSearchBridge.

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

71 {
72 global $DIC;
73
74 $ilDB = $DIC['ilDB'];
75
76 if (!$this->isNull() && $this->isValid()) {
77 return $a_element_id . " = " . $ilDB->quote($this->getADT()->getNumber(), "float");
78 }
79 }
global $ilDB
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

◆ importFromPost()

ilADTFloatSearchBridgeSingle::importFromPost ( array  $a_post = null)

Import values from (search) form request POST data.

Returns
bool

Reimplemented from ilADTSearchBridge.

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

54 {
55 $post = $this->extractPostValues($a_post);
56
57 if ($post && $this->shouldBeImportedFromPost($post)) {
58 $item = $this->getForm()->getItemByPostVar($this->getElementId());
59 $item->setValue($post);
60
61 $this->getADT()->setNumber($post);
62 } else {
63 $this->getADT()->setNumber();
64 }
65 }
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.

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

+ Here is the call graph for this function:

◆ isInCondition()

ilADTFloatSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

Compare directly against ADT.

Parameters
ilADT$a_adt
Returns
boolean

Reimplemented from ilADTSearchBridge.

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

82 {
83 assert($a_adt instanceof ilADTFloat);
84
85 return $this->getADT()->equals($a_adt);
86 }

References ilADTSearchBridgeSingle\getADT().

+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTFloatSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

Check if given ADT definition is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADTDefinition$a_adt_def

Reimplemented from ilADTSearchBridge.

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

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

◆ loadFilter()

ilADTFloatSearchBridgeSingle::loadFilter ( )

Load filter value(s) into ADT.

Reimplemented from ilADTSearchBridge.

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

16 {
17 $value = $this->readFilter();
18 if ($value !== null) {
19 $this->getADT()->setNumber($value);
20 }
21 }
readFilter()
Load value(s) from filter store (in session)

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

+ Here is the call graph for this function:

◆ setSerializedValue()

ilADTFloatSearchBridgeSingle::setSerializedValue (   $a_value)

Set current value(s) in serialized form (for easy persisting)

Parameters
string

Reimplemented from ilADTSearchBridge.

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

99 {
100 $a_value = unserialize($a_value);
101 if (is_array($a_value)) {
102 $this->getADT()->setNumber($a_value[0]);
103 }
104 }

References ilADTSearchBridgeSingle\getADT().

+ Here is the call graph for this function:

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