mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Added "selectToArray" functions in DBA and Item
This commit is contained in:
parent
eefcf99af4
commit
2be0ceac6b
2 changed files with 44 additions and 0 deletions
|
@ -408,6 +408,23 @@ class DBA
|
|||
return self::$database->selectFirst($table, $fields, $condition, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 static function selectToArray($table, array $fields = [], array $condition = [], array $params = [])
|
||||
{
|
||||
return self::$database->toArray(self::$database->select($table, $fields, $condition, $params));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Select rows from a table
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue