ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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...
 
 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 8 of file class.ilADTSearchBridgeRange.php.

Member Function Documentation

◆ getLowerADT()

◆ getUpperADT()

◆ isNull()

ilADTSearchBridgeRange::isNull ( )

◆ isValid()

ilADTSearchBridgeRange::isValid ( )

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

References getLowerADT(), and getUpperADT().

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

51  : bool
52  {
53  if (!$this->getLowerADT() instanceof ilADT || !$this->getUpperADT() instanceof ilADT) {
54  return false;
55  }
56  return ($this->getLowerADT()->isValid() && $this->getUpperADT()->isValid());
57  }
ADT base class.
Definition: class.ilADT.php:11
+ 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 13 of file class.ilADTSearchBridgeRange.php.

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

13  : void
14  {
15  if ($this->isValidADTDefinition($a_adt_def)) {
17  $this->adt_lower = $factory->getInstanceByDefinition($a_adt_def);
18  $this->adt_upper = $factory->getInstanceByDefinition($a_adt_def);
19  return;
20  }
21 
22  throw new InvalidArgumentException('ilADTSearchBridge type mismatch.');
23  }
isValidADTDefinition(ilADTDefinition $a_adt_def)
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:

◆ validate()

ilADTSearchBridgeRange::validate ( )

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

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

59  : bool
60  {
61  if (!$this->getLowerADT() instanceof ilADT || !$this->getUpperADT() instanceof ilADT) {
62  return false;
63  }
64  if (!$this->isValid()) {
65  $tmp = [];
66  $mess = $this->getLowerADT()->getValidationErrors();
67  foreach ($mess as $error_code) {
68  $tmp[] = $this->getLowerADT()->translateErrorCode($error_code);
69  }
70  if ($tmp) {
71  $field = $this->getForm()->getItemByPostVar($this->addToElementId("lower"));
72  $field->setAlert(implode("<br />", $tmp));
73  }
74 
75  $tmp = [];
76  $mess = $this->getUpperADT()->getValidationErrors();
77  foreach ($mess as $error_code) {
78  $tmp[] = $this->getUpperADT()->translateErrorCode($error_code);
79  }
80  if ($tmp) {
81  $field = $this->getForm()->getItemByPostVar($this->addToElementId("upper"));
82  $field->setAlert(implode("<br />", $tmp));
83  }
84  return false;
85  }
86  return true;
87  }
ADT base class.
Definition: class.ilADT.php:11
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 10 of file class.ilADTSearchBridgeRange.php.

Referenced by getLowerADT().

◆ $adt_upper

ilADT ilADTSearchBridgeRange::$adt_upper
protected

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

Referenced by getUpperADT().


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