ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADTSearchBridgeRange Class Reference

Class ilADTSearchBridgeRange. More...

+ Inheritance diagram for ilADTSearchBridgeRange:
+ Collaboration diagram for ilADTSearchBridgeRange:

Public Member Functions

 getLowerADT ()
 Get lower ADT. More...
 
 getUpperADT ()
 Get upper 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

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

Protected Attributes

ilADT $adt_lower
 
ilADT $adt_upper
 
- 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
 

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'
 

Detailed Description

Class ilADTSearchBridgeRange.

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

Member Function Documentation

◆ getLowerADT()

◆ getUpperADT()

◆ isNull()

ilADTSearchBridgeRange::isNull ( )

◆ isValid()

ilADTSearchBridgeRange::isValid ( )

Definition at line 67 of file class.ilADTSearchBridgeRange.php.

References getLowerADT(), and getUpperADT().

Referenced by ilADTDateSearchBridgeRange\getSerializedValue(), ilADTDateTimeSearchBridgeRange\getSerializedValue(), ilADTDateSearchBridgeRange\getSQLCondition(), ilADTDateTimeSearchBridgeRange\getSQLCondition(), and validate().

67  : bool
68  {
69  if (!$this->getLowerADT() instanceof ilADT || !$this->getUpperADT() instanceof ilADT) {
70  return false;
71  }
72  return ($this->getLowerADT()->isValid() && $this->getUpperADT()->isValid());
73  }
ADT base class.
Definition: class.ilADT.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDefinition()

ilADTSearchBridgeRange::setDefinition ( ilADTDefinition  $a_adt_def)
protected

Definition at line 29 of file class.ilADTSearchBridgeRange.php.

References ilADTFactory\getInstance(), and ilADTSearchBridge\isValidADTDefinition().

29  : void
30  {
31  if ($this->isValidADTDefinition($a_adt_def)) {
32  $factory = ilADTFactory::getInstance();
33  $this->adt_lower = $factory->getInstanceByDefinition($a_adt_def);
34  $this->adt_upper = $factory->getInstanceByDefinition($a_adt_def);
35  return;
36  }
37 
38  throw new InvalidArgumentException('ilADTSearchBridge type mismatch.');
39  }
isValidADTDefinition(ilADTDefinition $a_adt_def)
+ Here is the call graph for this function:

◆ validate()

ilADTSearchBridgeRange::validate ( )

Definition at line 75 of file class.ilADTSearchBridgeRange.php.

References ilADTSearchBridge\addToElementId(), ilADTSearchBridge\getForm(), getLowerADT(), getUpperADT(), and isValid().

75  : bool
76  {
77  if (!$this->getLowerADT() instanceof ilADT || !$this->getUpperADT() instanceof ilADT) {
78  return false;
79  }
80  if (!$this->isValid()) {
81  $tmp = [];
82  $mess = $this->getLowerADT()->getValidationErrors();
83  foreach ($mess as $error_code) {
84  $tmp[] = $this->getLowerADT()->translateErrorCode($error_code);
85  }
86  if ($tmp) {
87  $field = $this->getForm()->getItemByPostVar($this->addToElementId("lower"));
88  $field->setAlert(implode("<br />", $tmp));
89  }
90 
91  $tmp = [];
92  $mess = $this->getUpperADT()->getValidationErrors();
93  foreach ($mess as $error_code) {
94  $tmp[] = $this->getUpperADT()->translateErrorCode($error_code);
95  }
96  if ($tmp) {
97  $field = $this->getForm()->getItemByPostVar($this->addToElementId("upper"));
98  $field->setAlert(implode("<br />", $tmp));
99  }
100  return false;
101  }
102  return true;
103  }
ADT base class.
Definition: class.ilADT.php:25
addToElementId(string $a_add)
Add sub-element.
+ Here is the call graph for this function:

Field Documentation

◆ $adt_lower

ilADT ilADTSearchBridgeRange::$adt_lower
protected

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

Referenced by getLowerADT().

◆ $adt_upper

ilADT ilADTSearchBridgeRange::$adt_upper
protected

Definition at line 27 of file class.ilADTSearchBridgeRange.php.

Referenced by getUpperADT().


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