19 declare(strict_types=1);
38 if ($value !== null) {
39 $this->
getADT()->setText($value);
49 $text->setMaxLength(512);
50 $text->setSubmitFormOnEnter(
true);
52 $text->setValue($this->
getADT()->getText());
64 $item->setValue(
$post);
65 } elseif (array_key_exists($this->
getElementId(), $this->table_filter_fields)) {
73 $this->
getADT()->setText();
80 public function getSQLCondition(
string $a_element_id,
int $mode = self::SQL_LIKE, array $quotedWords = []): string
86 $quotedWords = $this->
getADT()->getText();
90 case self::SQL_STRICT:
91 if (!is_array($quotedWords)) {
92 return $a_element_id .
" = " . $this->db->quote($quotedWords,
"text");
94 return $this->db->in($a_element_id, $quotedWords,
false,
"text");
99 if (!is_array($quotedWords)) {
100 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords .
"%");
103 foreach ($quotedWords as $word) {
105 $tmp[] = $this->db->like($a_element_id,
"text",
"%" . $word .
"%");
109 return "(" . implode(
" OR ", $tmp) .
")";
114 case self::SQL_LIKE_END:
115 if (!is_array($quotedWords)) {
116 return $this->db->like($a_element_id,
"text", $quotedWords .
"%");
120 case self::SQL_LIKE_START:
121 if (!is_array($quotedWords)) {
122 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords);
131 if ($this->
getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) {
132 $search_term = strtolower(trim((
string) $this->
getADT()->getText()));
133 $text = strtolower(trim((
string) $a_adt->getText()));
134 return str_contains($text, $search_term);
144 return serialize(array($this->
getADT()->getText()));
151 $a_value = unserialize($a_value);
152 if (is_array($a_value)) {
153 $this->
getADT()->setText($a_value[0]);
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
isValidADTDefinition(ilADTDefinition $a_adt_def)
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
importFromPost(array $a_post=null)
readFilter()
Load value(s) from filter store (in session)
Class ilADTSearchBridgeSingle.
isInCondition(ilADT $a_adt)
writeFilter($a_value=null)
Write value(s) to filter store (in session)
ADT definition base class.
setSerializedValue(string $a_value)
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.