summaryrefslogtreecommitdiff
path: root/www/wiki/includes/libs/rdbms/encasing/LikeMatch.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/includes/libs/rdbms/encasing/LikeMatch.php')
-rw-r--r--www/wiki/includes/libs/rdbms/encasing/LikeMatch.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/www/wiki/includes/libs/rdbms/encasing/LikeMatch.php b/www/wiki/includes/libs/rdbms/encasing/LikeMatch.php
new file mode 100644
index 00000000..98812a5a
--- /dev/null
+++ b/www/wiki/includes/libs/rdbms/encasing/LikeMatch.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Wikimedia\Rdbms;
+
+/**
+ * Used by Database::buildLike() to represent characters that have special
+ * meaning in SQL LIKE clauses and thus need no escaping. Don't instantiate it
+ * manually, use Database::anyChar() and anyString() instead.
+ */
+class LikeMatch {
+ /** @var string */
+ private $str;
+
+ /**
+ * Store a string into a LikeMatch marker object.
+ *
+ * @param string $s
+ */
+ public function __construct( $s ) {
+ $this->str = $s;
+ }
+
+ /**
+ * Return the original stored string.
+ *
+ * @return string
+ */
+ public function toString() {
+ return $this->str;
+ }
+}