protected function determineSearchType($words) { foreach ($words as $word) { if (isset($this->searchTypes[$word])) { return $this->searchTypes[$word]; } } // if we do not recognise the word, tell the caller return null; }