@@ -258,4 +258,13 @@ class Db implements IDb { | |||
return $this->connection->tableExists($table); | |||
} | |||
/** | |||
* Espace a parameter to be used in a LIKE query | |||
* | |||
* @param string $param | |||
* @return string | |||
*/ | |||
public function escapeLikeParameter($param) { | |||
return $this->connection->escapeLikeParameter($param); | |||
} | |||
} |
@@ -301,4 +301,14 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { | |||
public function inTransaction() { | |||
return $this->getTransactionNestingLevel() > 0; | |||
} | |||
/** | |||
* Espace a parameter to be used in a LIKE query | |||
* | |||
* @param string $param | |||
* @return string | |||
*/ | |||
public function escapeLikeParameter($param) { | |||
return addcslashes($param, '\\_%'); | |||
} | |||
} |
@@ -206,4 +206,13 @@ interface IDBConnection { | |||
* @since 8.0.0 | |||
*/ | |||
public function tableExists($table); | |||
/** | |||
* Escape a parameter to be used in a LIKE query | |||
* | |||
* @param string $param | |||
* @return string | |||
* @since 9.0.0 | |||
*/ | |||
public function escapeLikeParameter($param); | |||
} |