Example #1
0
 public function getSearchCondition(Query $query, $table, $value, $searchmode, $fieldname = '')
 {
     // Multiselect attribute has only 1 searchmode, and that is substring.
     $searchcondition = '';
     if (is_array($value) && $value[0] != '' && count($value) > 0) {
         $searchcondition = [];
         foreach ($value as $str) {
             $searchcondition[] = $query->substringCondition($table . '.' . $this->fieldName(), $this->escapeSQL($str));
         }
         $searchcondition = implode(' OR ', $searchcondition);
     }
     return $searchcondition;
 }