BookStack\Repos\EntityRepo::prepareSearchTerms PHP Method

prepareSearchTerms() public method

Keeps quoted terms together.
public prepareSearchTerms ( $termString ) : array
$termString
return array
    public function prepareSearchTerms($termString)
    {
        $termString = $this->cleanSearchTermString($termString);
        preg_match_all('/(".*?")/', $termString, $matches);
        $terms = [];
        if (count($matches[1]) > 0) {
            foreach ($matches[1] as $match) {
                $terms[] = $match;
            }
            $termString = trim(preg_replace('/"(.*?)"/', '', $termString));
        }
        if (!empty($termString)) {
            $terms = array_merge($terms, explode(' ', $termString));
        }
        return $terms;
    }