19declare(strict_types=1);
44 if ($value !==
null) {
45 $this->
getADT()->setUrl($value);
67 $item->setValue(
$post);
68 } elseif (array_key_exists($this->
getElementId(), $this->table_filter_fields)) {
74 } elseif (array_key_exists($this->
getElementId(), $this->table_filter_fields)) {
80 $this->
getADT()->setUrl(
null);
92 public function getSQLCondition(
string $a_element_id,
int $mode = self::SQL_LIKE, array $quotedWords = []): string
98 protected function buildSQLCondition(
string $a_element_id,
int $mode = self::SQL_LIKE, array $quotedWords = []): string
104 $quotedWords = $this->
getADT()->getUrl();
109 if (!is_array($quotedWords)) {
110 return $a_element_id .
" = " . $this->db->quote($quotedWords,
"text");
112 return $this->db->in($a_element_id, $quotedWords,
false,
"text");
117 if (!is_array($quotedWords)) {
118 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords .
"%");
121 foreach ($quotedWords as $word) {
123 $tmp[] = $this->db->like($a_element_id,
"text",
"%" . $word .
"%");
127 return "(" . implode(
" OR ", $tmp) .
")";
133 if (!is_array($quotedWords)) {
134 return $this->db->like($a_element_id,
"text", $quotedWords .
"%");
139 if (!is_array($quotedWords)) {
140 return $this->db->like($a_element_id,
"text",
"%" . $quotedWords);
154 if ($this->
getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) {
155 $search_term = strtolower(trim((
string) $this->
getADT()->getUrl()));
156 $title = strtolower(trim((
string) $a_adt->getTitle()));
157 $url = strtolower(trim((
string) $a_adt->getUrl()));
159 str_contains(
$title, $search_term) ||
160 str_contains(
$url, $search_term);
172 return serialize(array($this->
getADT()->getUrl()));
183 $a_value = unserialize($a_value);
184 if (is_array($a_value)) {
185 $this->
getADT()->setUrl($a_value[0]);
ADT definition base class.
external link search bridge
isInCondition(ilADT $a_adt)
Is in condition.
loadFilter()
Load from filter.
setSerializedValue(string $a_value)
Set serialized value.
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
Get sql condition.
getSerializedValue()
get serialized value
isValidADTDefinition(\ilADTDefinition $a_adt_def)
Is valid type.
addToForm()
add external link property to form
buildSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
importFromPost(?array $a_post=null)
Class ilADTSearchBridgeSingle.
readFilter()
Load value(s) from filter store (in session)
extractPostValues(?array $a_post=null)
Extract data from (post) values.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
writeFilter($a_value=null)
Write value(s) to filter store (in session)
This class represents a text property in a property form.