Computes the SQL condition for search a set of column using regular expression
(or LIKE, depending on database implementation) to match a string of
keywords (default matches all keywords).
public getSearchExpression ( $fields, $keywords ) : string | ||
return | string | SQL search condition matching on a set of columns. |
/** * Overrides parent implementation. Only column of type text or character (and its variants) * accepts the LIKE criteria. * @param array list of column id for potential search condition. * @param string string of keywords * @return string SQL search condition matching on a set of columns. */ public function getSearchExpression($fields, $keywords) { $columns = array(); foreach ($fields as $field) { if ($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) { $columns[] = $field; } } return parent::getSearchExpression($columns, $keywords); }