src/Common/Model/Base.php
protected function applySearchConditionals(array &$aData, $sKeywords)
    {
        if (empty($aData['or_like'])) {
            $aData['or_like'] = [];
        }

        $sAlias = $this->getTableAlias(true);

        foreach ($this->searchableFields as $mField) {

            //  If the field is an array then search across the columns concatenated together
            if (is_array($mField)) {

                $sMappedFields = array_map(function ($sInput) use ($sAlias) {
                    if (strpos($sInput, '.') !== false) {
                        return $sInput;
                    } else {
                        return $sAlias . $sInput;
                    }
                }, $mField);

                $aData['or_like'][] = ['CONCAT_WS(" ", ' . implode(',', $sMappedFields) . ')', $sKeywords];
            } else {
                if (strpos($mField, '.') !== false) {
                    $aData['or_like'][] = [$mField, $sKeywords];
                } else {
                    $aData['or_like'][] = [$sAlias . $mField, $sKeywords];
                }
            }
        }
    }
protected function applySearchConditionals(array &$aData, $sKeywords)
    {
        if (empty($aData['or_like'])) {
            $aData['or_like'] = [];
        }

        $sAlias = $this->getTableAlias(true);

        foreach ($this->searchableFields as $mField) {

            //  If the field is an array then search across the columns concatenated together
            if (is_array($mField)) {

                $sMappedFields = array_map(function ($sInput) use ($sAlias) {
                    if (strpos($sInput, '.') !== false) {
                        return $sInput;
                    } else {
                        return $sAlias . $sInput;
                    }
                }, $mField);

                $aData['or_like'][] = ['CONCAT_WS(" ", ' . implode(',', $sMappedFields) . ')', $sKeywords];
            } else {
                if (strpos($mField, '.') !== false) {
                    $aData['or_like'][] = [$mField, $sKeywords];
                } else {
                    $aData['or_like'][] = [$sAlias . $mField, $sKeywords];
                }
            }
        }
    }
protected function applySearchConditionals ( array & $ aData , $ sKeywords ) { if ( empty ( $ aData [ 'or_like' ] ) ) { $ aData [ 'or_like' ] = [ ] ; } $ sAlias = $ this -> getTableAlias ( true ) ; foreach ( $ this -> searchableFields as $ mField ) { //  If the field is an array then search across the columns concatenated together if ( is_array ( $ mField ) ) { $ sMappedFields = array_map ( function ( $ sInput ) use ( $ sAlias ) { if ( strpos ( $ sInput , '.' ) !== false ) { return $ sInput ; } else { return $ sAlias . $ sInput ; } } , $ mField ) ; $ aData [ 'or_like' ] [ ] = [ 'CONCAT_WS(" ", ' . implode ( ',' , $ sMappedFields ) . ')' , $ sKeywords ] ; } else { if ( strpos ( $ mField , '.' ) !== false ) { $ aData [ 'or_like' ] [ ] = [ $ mField , $ sKeywords ] ; } else { $ aData [ 'or_like' ] [ ] = [ $ sAlias . $ mField , $ sKeywords ] ; } } } }
Mutates the data array and adds the conditionals for searching

@param array $aData
@param       $sKeywords
Mutates the data array and adds the conditionals for searching