searchTerm = trim($searchTerm); } /** * @return string */ public function getSearchTerm() { return $this->searchTerm; } /** * @return array */ public function getSearchWords() { if ($this->searchWords === null) { $this->searchWords = (array)preg_split('/([\s]+)/um', $this->searchTerm, -1, PREG_SPLIT_NO_EMPTY); } return $this->searchWords; } }