19 declare(strict_types=1);
33 if ($value !== null) {
34 $this->
getADT()->setText($value);
44 $text->setMaxLength(512);
45 $text->setSubmitFormOnEnter(
true);
47 $text->setValue($this->
getADT()->getText());
59 $item->setValue(
$post);
60 } elseif (array_key_exists($this->
getElementId(), $this->table_filter_fields)) {
67 $this->
getADT()->setText();
72 public function getSQLCondition(
string $a_element_id,
int $mode = self::SQL_LIKE, array $quotedWords = []): string
78 $quotedWords = $this->
getADT()->getText();
82 case self::SQL_STRICT:
83 if (!is_array($quotedWords)) {
84 return $a_element_id .
" = " . $this->db->quote($quotedWords,
"text");
86 return $this->db->in($a_element_id, $quotedWords,
false,
"text");
91 if (!is_array($quotedWords)) {
92 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords .
"%");
95 foreach ($quotedWords as $word) {
97 $tmp[] = $this->db->like($a_element_id,
"text",
"%" . $word .
"%");
101 return "(" . implode(
" OR ", $tmp) .
")";
106 case self::SQL_LIKE_END:
107 if (!is_array($quotedWords)) {
108 return $this->db->like($a_element_id,
"text", $quotedWords .
"%");
112 case self::SQL_LIKE_START:
113 if (!is_array($quotedWords)) {
114 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords);
123 if ($this->
getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) {
124 foreach ($a_adt->getTranslations() as $language => $text) {
125 $search_term = strtolower(trim((
string) $this->
getADT()->getText()));
126 $text = strtolower(trim((
string) $text));
127 if (str_contains($text, $search_term)) {
140 return serialize(array($this->
getADT()->getText()));
147 $a_value = unserialize($a_value);
148 if (is_array($a_value)) {
149 $this->
getADT()->setText($a_value[0]);
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
importFromPost(array $a_post=null)
setSerializedValue(string $a_value)
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
readFilter()
Load value(s) from filter store (in session)
isValidADTDefinition(ilADTDefinition $a_adt_def)
isInCondition(ilADT $a_adt)
writeFilter($a_value=null)
Write value(s) to filter store (in session)
ADT definition base class.
Class ilADTLocalizedText.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.