ILIAS  release_8 Revision v8.24
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)
 
 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...
 
- Public Member Functions inherited from ilADTSearchBridgeSingle
 getADT ()
 Get ADT. More...
 
 isNull ()
 
 isValid ()
 
 validate ()
 Validate current data. More...
 
- 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...
 
 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)
 
- 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 5 of file class.ilADTFloatSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTFloatSearchBridgeSingle::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTSearchBridge.

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

24 : void
25 {
26 $def = $this->getADT()->getCopyOfDefinition();
27
28 $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
29 $number->setSize(10);
30 $number->setDecimals($def->getDecimals());
31
32 $min = $def->getMin();
33 if ($min !== null) {
34 $number->setMinValue($min);
35 }
36 $max = $def->getMax();
37 if ($max !== null) {
38 $number->setMaxValue($max);
39
40 $length = strlen((string) $max);
41 $number->setSize($length);
42 $number->setMaxLength($length);
43 }
44 $number->setValue((string) $this->getADT()->getNumber());
45 $this->addToParentElement($number);
46 }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
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)

Reimplemented from ilADTSearchBridge.

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

83 : string
84 {
85 if (!$this->isNull() && $this->isValid()) {
86 return serialize(array($this->getADT()->getNumber()));
87 }
88 return '';
89 }

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

+ Here is the call graph for this function:

◆ getSQLCondition()

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

Get SQL condition for current value(s)

Reimplemented from ilADTSearchBridge.

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

65 : string
66 {
67 if (!$this->isNull() && $this->isValid()) {
68 return $a_element_id . " = " . $this->db->quote($this->getADT()->getNumber(), "float");
69 }
70 return '';
71 }

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

+ Here is the call graph for this function:

◆ importFromPost()

ilADTFloatSearchBridgeSingle::importFromPost ( array  $a_post = null)
Todo:
make post required

Reimplemented from ilADTSearchBridge.

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

48 : bool
49 {
50 $post = $this->extractPostValues($a_post);
51
52 if ($post && $this->shouldBeImportedFromPost($post)) {
53 $item = $this->getForm()->getItemByPostVar($this->getElementId());
54 $item->setValue($post);
55
56 $this->getADT()->setNumber($post);
57 } else {
58 $this->getADT()->setNumber();
59 }
60 return true;
61 }
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
$post
Definition: ltitoken.php:49

References $post, 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.

Reimplemented from ilADTSearchBridge.

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

73 : bool
74 {
75 if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) {
76 return $this->getADT()->equals($a_adt);
77 }
78 return false;
79 }

References ilADTSearchBridgeSingle\getADT().

+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTFloatSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

Reimplemented from ilADTSearchBridge.

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

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

◆ loadFilter()

ilADTFloatSearchBridgeSingle::loadFilter ( )

Load filter value(s) into ADT.

Reimplemented from ilADTSearchBridge.

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

14 : void
15 {
16 $value = $this->readFilter();
17 if ($value !== null) {
18 $this->getADT()->setNumber($value);
19 }
20 }
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 ( string  $a_value)

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

Reimplemented from ilADTSearchBridge.

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

91 : void
92 {
93 $a_value = unserialize($a_value);
94 if (is_array($a_value)) {
95 $this->getADT()->setNumber($a_value[0]);
96 }
97 }

References ilADTSearchBridgeSingle\getADT().

+ Here is the call graph for this function:

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