From: Michael Date: Sat, 27 Jul 2019 16:08:48 +0000 (+0000) Subject: Moved function to Database.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=555c444b4e283261d2efe376b5803e0adbf5e214;p=friendica.git Moved function to Database.php --- diff --git a/src/Database/DBA.php b/src/Database/DBA.php index 937693a792..4619bc38b8 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -422,7 +422,7 @@ class DBA */ public static function selectToArray($table, array $fields = [], array $condition = [], array $params = []) { - return self::$database->toArray(self::$database->select($table, $fields, $condition, $params)); + return self::$database->selectToArray($table, $fields, $condition, $params); } /** diff --git a/src/Database/Database.php b/src/Database/Database.php index c503416912..566a757b51 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -1407,6 +1407,23 @@ class Database } } + /** + * @brief Select rows from a table and fills an array with the data + * + * @param string $table Table name + * @param array $fields Array of selected fields, empty for all + * @param array $condition Array of fields for condition + * @param array $params Array of several parameters + * + * @return array Data array + * @throws \Exception + * @see self::select + */ + public function selectToArray($table, array $fields = [], array $condition = [], array $params = []) + { + return $this->toArray($this->select($table, $fields, $condition, $params)); + } + /** * @brief Select rows from a table *