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
544 B

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