LikeMatch.php 587 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Wikimedia\Rdbms;
  3. /**
  4. * Used by Database::buildLike() to represent characters that have special
  5. * meaning in SQL LIKE clauses and thus need no escaping. Don't instantiate it
  6. * manually, use Database::anyChar() and anyString() instead.
  7. */
  8. class LikeMatch {
  9. /** @var string */
  10. private $str;
  11. /**
  12. * Store a string into a LikeMatch marker object.
  13. *
  14. * @param string $s
  15. */
  16. public function __construct( $s ) {
  17. $this->str = $s;
  18. }
  19. /**
  20. * Return the original stored string.
  21. *
  22. * @return string
  23. */
  24. public function toString() {
  25. return $this->str;
  26. }
  27. }