ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ilADTIntegerSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTIntegerSearchBridgeSingle:
+ Collaboration diagram for ilADTIntegerSearchBridgeSingle:

Public Member Functions

 loadFilter ()
 
 addToForm ()
 
 importFromPost (?array $a_post=null)
 
 getSQLCondition (string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
 
 isInCondition (ilADT $a_adt)
 
 getSerializedValue ()
 
 setSerializedValue (string $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)
 
 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...
 
 addToFilterForm ()
 Add ADT-specific fields to filter. 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 21 of file class.ilADTIntegerSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTIntegerSearchBridgeSingle::addToForm ( )

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

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

40  : void
41  {
42  $def = $this->getADT()->getCopyOfDefinition();
43 
44  $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId());
45  $number->setSize(10);
46 
47  $min = $def->getMin();
48  // do not set min value for search
49  if ($min !== null) {
50  //$number->setMinValue($min);
51  }
52  $max = $def->getMax();
53  // do not set min value for search
54  if ($max !== null) {
55  #$number->setMaxValue($max);
56  #$length = strlen((string) $max);
57  #$number->setSize($length);
58  #$number->setMaxLength($length);
59  }
60  $number->setValue((string) $this->getADT()->getNumber());
61  $this->addToParentElement($number);
62  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This class represents a number property in a property form.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
+ Here is the call graph for this function:

◆ getSerializedValue()

ilADTIntegerSearchBridgeSingle::getSerializedValue ( )

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

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

98  : string
99  {
100  if (!$this->isNull() && $this->isValid()) {
101  return serialize(array($this->getADT()->getNumber()));
102  }
103  return '';
104  }
+ Here is the call graph for this function:

◆ getSQLCondition()

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

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

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

80  : string
81  {
82  if (!$this->isNull() && $this->isValid()) {
83  return $a_element_id . " = " . $this->db->quote($this->getADT()->getNumber(), "integer");
84  }
85  return '';
86  }
+ Here is the call graph for this function:

◆ importFromPost()

ilADTIntegerSearchBridgeSingle::importFromPost ( ?array  $a_post = null)

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

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

64  : bool
65  {
66  $post = $this->extractPostValues($a_post);
67 
68  if ($post && $this->shouldBeImportedFromPost($post)) {
69  $item = $this->getForm()->getItemByPostVar($this->getElementId());
70  $item->setValue($post);
71  $this->getADT()->setNumber($post);
72  } else {
73  $this->getADT()->setNumber();
74  }
75  return true;
76  }
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
extractPostValues(?array $a_post=null)
Extract data from (post) values.
$post
Definition: ltitoken.php:46
+ Here is the call graph for this function:

◆ isInCondition()

ilADTIntegerSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

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

References ilADTSearchBridgeSingle\getADT().

88  : bool
89  {
90  if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) {
91  return $this->getADT()->equals($a_adt);
92  }
93  return false;
94  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTIntegerSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

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

23  : bool
24  {
25  return ($a_adt_def instanceof ilADTIntegerDefinition);
26  }

◆ loadFilter()

ilADTIntegerSearchBridgeSingle::loadFilter ( )

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

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

30  : void
31  {
32  $value = $this->readFilter();
33  if ($value !== null) {
34  $this->getADT()->setNumber($value);
35  }
36  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readFilter()
Load value(s) from filter store (in session)
+ Here is the call graph for this function:

◆ setSerializedValue()

ilADTIntegerSearchBridgeSingle::setSerializedValue ( string  $a_value)

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

References ilADTSearchBridgeSingle\getADT().

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

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