You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
573 B

  1. <?php namespace TomLingham\Searchy\Matchers;
  2. /**
  3. * Matches strings for Acronym 'like' matches but does NOT return Studly Case Matches
  4. *
  5. * for example, a search for 'fb' would match; 'foo bar' or 'Fred Brown' but not 'FreeBeer'.
  6. *
  7. * Class AcronymMatcher
  8. * @package TomLingham\Searchy\Matchers
  9. */
  10. class LevenshteinMatcher extends BaseMatcher
  11. {
  12. /**
  13. * @param $column
  14. * @param $searchString
  15. * @return mixed|string
  16. */
  17. public function buildQueryString( $column, $searchString )
  18. {
  19. return "levenshtein($column, '$searchString')";
  20. }
  21. }