From 79f746d014c87997bb29c37464e51f446c427803 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sun, 14 Apr 2019 18:51:04 +0200 Subject: [PATCH] Fix static calls --- src/Database/DBA.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Database/DBA.php b/src/Database/DBA.php index b0ecbcdaf8..34b11e4660 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -408,6 +408,29 @@ class DBA return self::$dba->count($table, $condition); } + /** + * @brief Returns the SQL condition string built from the provided condition array + * + * This function operates with two modes. + * - Supplied with a filed/value associative array, it builds simple strict + * equality conditions linked by AND. + * - Supplied with a flat list, the first element is the condition string and + * the following arguments are the values to be interpolated + * + * $condition = ["uid" => 1, "network" => 'dspr']; + * or: + * $condition = ["`uid` = ? AND `network` IN (?, ?)", 1, 'dfrn', 'dspr']; + * + * In either case, the provided array is left with the parameters only + * + * @param array $condition + * @return string + */ + public static function buildCondition(array &$condition = []) + { + return Database::buildCondition($condition); + } + /** * @brief Fills an array with data from a query * @@ -420,6 +443,17 @@ class DBA return self::$dba->toArray($stmt, $do_close); } + /** + * @brief Returns the SQL parameter string built from the provided parameter array + * + * @param array $params + * @return string + */ + public static function buildParameter(array $params = []) + { + return Database::buildParameter($params); + } + /** * @brief Returns the error number of the last query *