Rename DBM method calls to DBA method calls

This commit is contained in:
Hypolite Petovan 2018-07-21 08:40:21 -04:00 committed by Hypolite Petovan
parent 8ddb94ef06
commit 0ec44f3e8a
153 changed files with 813 additions and 918 deletions

View file

@ -16,7 +16,6 @@ use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
@ -91,7 +90,7 @@ class Profile
{
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
if (!DBM::is_result($user) && empty($profiledata)) {
if (!DBA::is_result($user) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404;
@ -102,7 +101,7 @@ class Profile
// Add profile data to sidebar
$a->page['aside'] .= self::sidebar($profiledata, true, $show_connect);
if (!DBM::is_result($user)) {
if (!DBA::is_result($user)) {
return;
}
}
@ -199,7 +198,7 @@ class Profile
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $uid) {
$contact = DBA::selectFirst('contact', ['profile-id'], ['id' => $visitor['cid']]);
if (DBM::is_result($contact)) {
if (DBA::is_result($contact)) {
$profile_id = $contact['profile-id'];
}
break;
@ -223,7 +222,7 @@ class Profile
intval($profile_id)
);
}
if (!DBM::is_result($profile)) {
if (!DBA::is_result($profile)) {
$profile = DBA::fetchFirst(
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
@ -375,7 +374,7 @@ class Profile
'entries' => [],
];
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
foreach ($r as $rr) {
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
@ -453,7 +452,7 @@ class Profile
"SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
intval($a->profile['uid'])
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$updated = date('c', strtotime($r[0]['updated']));
}
@ -468,7 +467,7 @@ class Profile
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$contacts = intval($r[0]['total']);
}
}
@ -556,7 +555,7 @@ class Profile
DateTimeFormat::utc('now + 6 days'),
DateTimeFormat::utcNow()
);
if (DBM::is_result($s)) {
if (DBA::is_result($s)) {
$r = DBA::toArray($s);
Cache::set($cachekey, $r, CACHE_HOUR);
}
@ -564,7 +563,7 @@ class Profile
$total = 0;
$classtoday = '';
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$now = strtotime('now');
$cids = [];
@ -658,7 +657,7 @@ class Profile
$r = [];
if (DBM::is_result($s)) {
if (DBA::is_result($s)) {
$istoday = false;
while ($rr = DBA::fetch($s)) {
@ -1027,7 +1026,7 @@ class Profile
$contact = DBA::selectFirst('contact',['id', 'url'], ['id' => $cid]);
if (DBM::is_result($contact) && remote_user() && remote_user() == $contact['id']) {
if (DBA::is_result($contact) && remote_user() && remote_user() == $contact['id']) {
// The visitor is already authenticated.
return;
}