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.

27 lines
564 B

  1. <?php namespace TomLingham\Searchy\Matchers;
  2. /**
  3. * Matches against any occurrences of a string within a string and is case-insensitive.
  4. *
  5. * For example, a search for 'smi' would match; 'John Smith' or 'Smiley Face'
  6. *
  7. * Class InStringMatcher
  8. * @package TomLingham\Searchy\Matchers
  9. */
  10. class InStringMatcher extends BaseMatcher
  11. {
  12. /**
  13. * @var string
  14. */
  15. protected $operator = 'LIKE';
  16. /**
  17. * @param $searchString
  18. * @return string
  19. */
  20. public function formatSearchString( $searchString )
  21. {
  22. return "%$searchString%";
  23. }
  24. }