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