mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 01:25:21 +02:00
Merge pull request #5431 from MrPetovan/task/5410-rename-database-methods
Move DBA to src/ part 3.1: Rename DBA methods
This commit is contained in:
commit
2d0a749734
30 changed files with 142 additions and 142 deletions
|
@ -479,7 +479,7 @@ function admin_page_contactblock(App $a)
|
|||
|
||||
$statement = DBA::select('contact', [], $condition, ['limit' => [$a->pager['start'], $a->pager['itemspage']]]);
|
||||
|
||||
$contacts = DBA::inArray($statement);
|
||||
$contacts = DBA::toArray($statement);
|
||||
|
||||
$t = get_markup_template('admin/contactblock.tpl');
|
||||
$o = replace_macros($t, [
|
||||
|
@ -782,7 +782,7 @@ function admin_page_workerqueue(App $a)
|
|||
{
|
||||
// get jobs from the workerqueue table
|
||||
$statement = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], ['done' => 0], ['order'=> ['priority']]);
|
||||
$r = DBA::inArray($statement);
|
||||
$r = DBA::toArray($statement);
|
||||
|
||||
for($i = 0; $i < count($r); $i++) {
|
||||
$r[$i]['parameter'] = implode(json_decode($r[$i]['parameter']), ': ');
|
||||
|
@ -816,7 +816,7 @@ function admin_page_workerqueue(App $a)
|
|||
function admin_page_summary(App $a)
|
||||
{
|
||||
// are there MyISAM tables in the DB? If so, trigger a warning message
|
||||
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::database_name()));
|
||||
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::databaseName()));
|
||||
$showwarning = false;
|
||||
$warningtext = [];
|
||||
if (DBM::is_result($r)) {
|
||||
|
|
|
@ -198,14 +198,14 @@ function community_getitems($start, $itemspage, $content)
|
|||
AND NOT `thread`.`private` AND `thread`.`wall` AND `thread`.`origin`
|
||||
ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage)
|
||||
);
|
||||
return DBA::inArray($r);
|
||||
return DBA::toArray($r);
|
||||
} elseif ($content == 'global') {
|
||||
$r = DBA::p("SELECT `uri` FROM `thread`
|
||||
INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
|
||||
INNER JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id`
|
||||
WHERE `thread`.`uid` = 0 AND NOT `author`.`hidden` AND NOT `author`.`blocked`
|
||||
ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage));
|
||||
return DBA::inArray($r);
|
||||
return DBA::toArray($r);
|
||||
}
|
||||
|
||||
// Should never happen
|
||||
|
|
|
@ -213,7 +213,7 @@ function dfrn_dispatch_public($postdata)
|
|||
}
|
||||
|
||||
// We now have some contact, so we fetch it
|
||||
$importer = DBA::fetch_first("SELECT *, `name` as `senderName`
|
||||
$importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
|
||||
FROM `contact`
|
||||
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
||||
$contact['id']);
|
||||
|
@ -252,7 +252,7 @@ function dfrn_dispatch_private($user, $postdata)
|
|||
}
|
||||
|
||||
// We now have some contact, so we fetch it
|
||||
$importer = DBA::fetch_first("SELECT *, `name` as `senderName`
|
||||
$importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
|
||||
FROM `contact`
|
||||
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
||||
$cid);
|
||||
|
|
|
@ -83,7 +83,7 @@ function directory_content(App $a)
|
|||
$publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
|
||||
|
||||
|
||||
$cnt = DBA::fetch_first("SELECT COUNT(*) AS `total` FROM `profile`
|
||||
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
|
||||
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
|
||||
if (DBM::is_result($cnt)) {
|
||||
|
|
|
@ -87,7 +87,7 @@ function display_init(App $a)
|
|||
$nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
|
||||
|
||||
if (($nickname != $a->user["nickname"])) {
|
||||
$profile = DBA::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
||||
$profile = DBA::fetchFirst("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
||||
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
|
||||
$nickname
|
||||
|
|
|
@ -845,7 +845,7 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
local_user(), TERM_OBJ_POST, TERM_HASHTAG,
|
||||
$top_limit, $bottom_limit);
|
||||
|
||||
$data = DBA::inArray($items);
|
||||
$data = DBA::toArray($items);
|
||||
|
||||
if (count($data) > 0) {
|
||||
$tag_top_limit = current($data)['order_date'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue