concrete/src/Database/Query/LikeBuilder.php
public function splitKeywordsForLike($string, $wordSeparators = '\s', $addWildcards = true)
    {
        $result = null;
        if (is_string($string)) {
            $words = preg_split('/[' . $wordSeparators . ']+/ms', $string);
            foreach ($words as $word) {
                if ($word !== '') {
                    $result[] = $this->escapeForLike($word, $addWildcards, $addWildcards);
                }
            }
        }

        return $result;
    }
public function splitKeywordsForLike($string, $wordSeparators = '\s', $addWildcards = true)
    {
        $result = null;
        if (is_string($string)) {
            $words = preg_split('/[' . $wordSeparators . ']+/ms', $string);
            foreach ($words as $word) {
                if ($word !== '') {
                    $result[] = $this->escapeForLike($word, $addWildcards, $addWildcards);
                }
            }
        }

        return $result;
    }
public function splitKeywordsForLike ( $ string , $ wordSeparators = '\s' , $ addWildcards = true ) { $ result = null ; if ( is_string ( $ string ) ) { $ words = preg_split ( '/[' . $ wordSeparators . ']+/ms' , $ string ) ; foreach ( $ words as $ word ) { if ( $ word !== '' ) { $ result [ ] = $ this -> escapeForLike ( $ word , $ addWildcards , $ addWildcards ) ; } } } return $ result ; }
Split a string into words and format them to be used in LIKE queries.

@param string|mixed $string The string to be splitted
@param string $wordSeparators The regular expression pattern that represents potential word delimiters (eg '\s' for any whitespace character)
@param bool $addWildcards whether to add any-character wildcard at start and end of every resulting word

@return string[]|null Returns null if no word has been found, an array of escaped words otherwise
Split a string into words and format them to be used in LIKE queries .