ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADTIntegerSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTIntegerSearchBridgeSingle:
+ Collaboration diagram for ilADTIntegerSearchBridgeSingle:

Public Member Functions

 addToForm ()
 
 importFromPost (array $a_post=null)
 
 getSQLCondition ($a_element_id)
 
 isInCondition (ilADTInteger $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.ilADTIntegerSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTIntegerSearchBridgeSingle::addToForm ( )

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

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

16  {
17  $def = $this->getADT()->getCopyOfDefinition();
18 
19  $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
20  $number->setSize(10);
21 
22  $min = $def->getMin();
23  if($min !== null)
24  {
25  $number->setMinValue($min);
26  }
27 
28  $max = $def->getMax();
29  if($max !== null)
30  {
31  $number->setMaxValue($max);
32 
33  $length = strlen($max);
34  $number->setSize($length);
35  $number->setMaxLength($length);
36  }
37 
38  $this->addToParentElement($number);
39  }
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()

ilADTIntegerSearchBridgeSingle::getSerializedValue ( )

Definition at line 79 of file class.ilADTIntegerSearchBridgeSingle.php.

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

80  {
81  if(!$this->isNull() && $this->isValid())
82  {
83  return serialize(array($this->getADT()->getNumber()));
84  }
85  }
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTIntegerSearchBridgeSingle::getSQLCondition (   $a_element_id)

Definition at line 61 of file class.ilADTIntegerSearchBridgeSingle.php.

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

62  {
63  global $ilDB;
64 
65  if(!$this->isNull() && $this->isValid())
66  {
67  return $a_element_id." = ".$ilDB->quote($this->getADT()->getNumber(), "integer");
68  }
69  }
global $ilDB
+ Here is the call graph for this function:

◆ importFromPost()

ilADTIntegerSearchBridgeSingle::importFromPost ( array  $a_post = null)

Definition at line 41 of file class.ilADTIntegerSearchBridgeSingle.php.

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

42  {
43  $post = $this->extractPostValues($a_post);
44 
45  if($post && $this->shouldBeImportedFromPost($post))
46  {
47  $item = $this->getForm()->getItemByPostVar($this->getElementId());
48  $item->setValue($post);
49 
50  $this->getADT()->setNumber($post);
51  }
52  else
53  {
54  $this->getADT()->setNumber();
55  }
56  }
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()

ilADTIntegerSearchBridgeSingle::isInCondition ( ilADTInteger  $a_adt)

Definition at line 71 of file class.ilADTIntegerSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

72  {
73  return $this->getADT()->equals($a_adt);
74  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTIntegerSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

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

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

◆ setSerializedValue()

ilADTIntegerSearchBridgeSingle::setSerializedValue (   $a_value)

Definition at line 87 of file class.ilADTIntegerSearchBridgeSingle.php.

88  {
89  $a_value = unserialize($a_value);
90  if(is_array($a_value))
91  {
92  $this->getLowerADT()->setNumber($a_value[0]);
93  }
94  }

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