Skip to content

Commit

Permalink
Update domain.php
Browse files Browse the repository at this point in the history
vermeide Fehlermeldung in yakamara/yform#1535 und FriendsOfREDAXO/neues#128 gemeldet.
  • Loading branch information
alxndr-w authored Nov 16, 2024
1 parent 0811412 commit cc1ed89
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions lib/yform/value/domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,41 +117,4 @@ public static function getSearchField(array $params): void
],
);
}

public static function getSearchFilter(array $params): string
{
$sql = rex_sql::factory();

$field = $params['field']->getName();

$self = new self();
$values = $self->getArrayFromString($params['value']);

$multiple = true;

$where = [];
foreach ($values as $value) {
switch ($value) {
case '(empty)':
$where[] = ' ' . $sql->escapeIdentifier($field) . ' = ""';
break;
case '!(empty)':
$where[] = ' ' . $sql->escapeIdentifier($field) . ' != ""';
break;
default:
if ($multiple) {
$where[] = ' ( FIND_IN_SET( ' . $sql->escape($value) . ', ' . $sql->escapeIdentifier($field) . ') )';
} else {
$where[] = ' ( ' . $sql->escape($value) . ' = ' . $sql->escapeIdentifier($field) . ' )';
}

break;
}
}

if (count($where) > 0) {
return ' ( ' . implode(' or ', $where) . ' )';
}
return '';
}
}

0 comments on commit cc1ed89

Please sign in to comment.