ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADTEnumSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTEnumSearchBridgeSingle:
+ Collaboration diagram for ilADTEnumSearchBridgeSingle:

Public Member Functions

 loadFilter ()
 
 getSearchColumn ()
 
 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...
 

Data Fields

const ENUM_SEARCH_COLUMN = 'value_index'
 
- 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 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

- 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.ilADTEnumSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTEnumSearchBridgeSingle::addToForm ( )

Definition at line 47 of file class.ilADTEnumSearchBridgeSingle.php.

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

47  : void
48  {
49  $def = $this->getADT()->getCopyOfDefinition();
50 
51  $options = $def->getOptions();
52 
53  $this->lng->loadLanguageModule("search");
54  $options = array("" => $this->lng->txt("search_any")) + $options;
55 
56  $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId());
57  $select->setOptions($options);
58 
59  $select->setValue($this->getADT()->getSelection());
60 
61  $this->addToParentElement($select);
62  }
This class represents a selection list property in a property form.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
+ Here is the call graph for this function:

◆ getSearchColumn()

ilADTEnumSearchBridgeSingle::getSearchColumn ( )

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

Referenced by getSQLCondition().

40  : string
41  {
42  return self::ENUM_SEARCH_COLUMN;
43  }
+ Here is the caller graph for this function:

◆ getSerializedValue()

ilADTEnumSearchBridgeSingle::getSerializedValue ( )

Definition at line 107 of file class.ilADTEnumSearchBridgeSingle.php.

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

107  : string
108  {
109  if (!$this->isNull() && $this->isValid()) {
110  return serialize(array($this->getADT()->getSelection()));
111  }
112  return '';
113  }
+ Here is the call graph for this function:

◆ getSQLCondition()

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

Definition at line 89 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), getSearchColumn(), ilADTSearchBridgeSingle\isNull(), ilADTSearchBridgeSingle\isValid(), and ilDBConstants\T_TEXT.

89  : string
90  {
91  $search_column = $this->getSearchColumn();
92  if (!$this->isNull() && $this->isValid()) {
93  return $search_column . ' = ' . $this->db->quote($this->getADT()->getSelection(), ilDBConstants::T_TEXT);
94  }
95  return '';
96  }
+ Here is the call graph for this function:

◆ importFromPost()

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

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

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

64  : bool
65  {
66  $post = $this->extractPostValues($a_post);
67  if (
68  is_numeric($post) &&
70  ) {
71  if ($this->getForm() instanceof ilPropertyFormGUI) {
72  $item = $this->getForm()->getItemByPostVar($this->getElementId());
73  $item->setValue($post);
74  } elseif (array_key_exists($this->getElementId(), $this->table_filter_fields)) {
75  $this->table_filter_fields[$this->getElementId()]->setValue($post);
76  $this->writeFilter($post);
77  }
78 
79  $this->getADT()->setSelection($post);
80  } else {
81  $this->writeFilter();
82  $this->getADT()->setSelection();
83  }
84  return true;
85  }
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
extractPostValues(?array $a_post=null)
Extract data from (post) values.
writeFilter($a_value=null)
Write value(s) to filter store (in session)
$post
Definition: ltitoken.php:46
+ Here is the call graph for this function:

◆ isInCondition()

ilADTEnumSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

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

References ilADTSearchBridgeSingle\getADT().

98  : bool
99  {
100  assert($a_adt instanceof ilADTEnum);
101 
102  return $this->getADT()->equals($a_adt);
103  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTEnumSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

Definition at line 25 of file class.ilADTEnumSearchBridgeSingle.php.

25  : bool
26  {
27  return ($a_adt_def instanceof ilADTEnumDefinition);
28  }

◆ loadFilter()

ilADTEnumSearchBridgeSingle::loadFilter ( )

Definition at line 32 of file class.ilADTEnumSearchBridgeSingle.php.

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

32  : void
33  {
34  $value = $this->readFilter();
35  if ($value !== null) {
36  $this->getADT()->setSelection($value);
37  }
38  }
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()

ilADTEnumSearchBridgeSingle::setSerializedValue ( string  $a_value)

Definition at line 115 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

115  : void
116  {
117  $a_value = unserialize($a_value);
118  if (is_array($a_value) && !empty($a_value)) {
119  $this->getADT()->setSelection($a_value[0]);
120  }
121  }
+ Here is the call graph for this function:

Field Documentation

◆ ENUM_SEARCH_COLUMN

const ilADTEnumSearchBridgeSingle::ENUM_SEARCH_COLUMN = 'value_index'

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


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