*/
class TextFilter implements IGridViewFilter
{
+ public function __construct(private readonly string $columnName = '') {}
+
#[\Override]
public function getFormField(string $id, string $label): AbstractFormField
{
#[\Override]
public function applyFilter(DatabaseObjectList $list, string $id, string $value): void
{
- $list->getConditionBuilder()->add("$id LIKE ?", ['%' . WCF::getDB()->escapeLikeValue($value) . '%']);
+ $list->getConditionBuilder()->add(
+ ($this->columnName ?: $id) . " LIKE ?",
+ ['%' . WCF::getDB()->escapeLikeValue($value) . '%']
+ );
}
#[\Override]