Rename DBA::is_result to DBA::isResult

This commit is contained in:
Hypolite Petovan 2018-07-21 08:46:04 -04:00 committed by Hypolite Petovan
parent 0ec44f3e8a
commit ecea7425f8
152 changed files with 765 additions and 765 deletions

View file

@ -53,7 +53,7 @@ class Contact extends BaseObject
$gid,
local_user()
);
if (DBA::is_result($stmt)) {
if (DBA::isResult($stmt)) {
$return = DBA::toArray($stmt);
}
}
@ -103,7 +103,7 @@ class Contact extends BaseObject
}
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname'], ['uid' => $uid]);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return false;
}
@ -146,20 +146,20 @@ class Contact extends BaseObject
$fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'gender', 'avatar',
'xmpp', 'contact-type', 'forum', 'prv', 'avatar-date', 'nurl'];
$self = DBA::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]);
if (!DBA::is_result($self)) {
if (!DBA::isResult($self)) {
return;
}
$fields = ['nickname', 'page-flags', 'account-type'];
$user = DBA::selectFirst('user', $fields, ['uid' => $uid]);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return;
}
$fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region',
'country-name', 'gender', 'pub_keywords', 'xmpp'];
$profile = DBA::selectFirst('profile', $fields, ['uid' => $uid, 'is-default' => true]);
if (!DBA::is_result($profile)) {
if (!DBA::isResult($profile)) {
return;
}
@ -170,7 +170,7 @@ class Contact extends BaseObject
'contact-type' => $user['account-type'], 'xmpp' => $profile['xmpp']];
$avatar = DBA::selectFirst('photo', ['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
if (DBA::is_result($avatar)) {
if (DBA::isResult($avatar)) {
if ($update_avatar) {
$fields['avatar-date'] = DateTimeFormat::utcNow();
}
@ -244,7 +244,7 @@ class Contact extends BaseObject
{
// We want just to make sure that we don't delete our "self" contact
$contact = DBA::selectFirst('contact', ['uid'], ['id' => $id, 'self' => false]);
if (!DBA::is_result($contact) || !intval($contact['uid'])) {
if (!DBA::isResult($contact) || !intval($contact['uid'])) {
return;
}
@ -403,7 +403,7 @@ class Contact extends BaseObject
$r = DBA::toArray($s);
// Fetch contact data from the contact table for the given user, checking with the alias
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$s = DBA::p("SELECT `id`, `id` AS `cid`, 0 AS `gid`, 0 AS `zid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, `self`
FROM `contact` WHERE `alias` IN (?, ?, ?) AND `uid` = ?", normalise_link($url), $url, $ssl_url, $uid);
@ -411,7 +411,7 @@ class Contact extends BaseObject
}
// Fetch the data from the contact table with "uid=0" (which is filled automatically)
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$s = DBA::p("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self`
FROM `contact` WHERE `nurl` = ? AND `uid` = 0", normalise_link($url));
@ -419,7 +419,7 @@ class Contact extends BaseObject
}
// Fetch the data from the contact table with "uid=0" (which is filled automatically) - checked with the alias
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$s = DBA::p("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self`
FROM `contact` WHERE `alias` IN (?, ?, ?) AND `uid` = 0", normalise_link($url), $url, $ssl_url);
@ -427,14 +427,14 @@ class Contact extends BaseObject
}
// Fetch the data from the gcontact table
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$s = DBA::p("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`,
`keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, 0 AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self`
FROM `gcontact` WHERE `nurl` = ?", normalise_link($url));
$r = DBA::toArray($s);
}
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
// If there is more than one entry we filter out the connector networks
if (count($r) > 1) {
foreach ($r as $id => $result) {
@ -540,7 +540,7 @@ class Contact extends BaseObject
intval($uid)
);
// Fetch the data from the contact table with "uid=0" (which is filled automatically)
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$r = q("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self`
FROM `contact` WHERE `addr` = '%s' AND `uid` = 0",
@ -549,7 +549,7 @@ class Contact extends BaseObject
}
// Fetch the data from the gcontact table
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`,
`keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self`
FROM `gcontact` WHERE `addr` = '%s'",
@ -557,7 +557,7 @@ class Contact extends BaseObject
);
}
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$data = Probe::uri($addr);
$profile = self::getDetailsByURL($data['url'], $uid);
@ -602,7 +602,7 @@ class Contact extends BaseObject
// Look for our own contact if the uid doesn't match and isn't public
$contact_own = DBA::selectFirst('contact', [], ['nurl' => $contact['nurl'], 'network' => $contact['network'], 'uid' => $uid]);
if (DBA::is_result($contact_own)) {
if (DBA::isResult($contact_own)) {
return self::photoMenu($contact_own, $uid);
} else {
$profile_link = self::magicLink($contact['url']);
@ -748,19 +748,19 @@ class Contact extends BaseObject
$contact = DBA::selectFirst('contact', ['id', 'avatar', 'avatar-date'], ['nurl' => normalise_link($url), 'uid' => $uid]);
// Then the addr (nick@server.tld)
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
$contact = DBA::selectFirst('contact', ['id', 'avatar', 'avatar-date'], ['addr' => $url, 'uid' => $uid]);
}
// Then the alias (which could be anything)
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
// The link could be provided as http although we stored it as https
$ssl_url = str_replace('http://', 'https://', $url);
$condition = ['`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid];
$contact = DBA::selectFirst('contact', ['id', 'avatar', 'avatar-date'], $condition);
}
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$contact_id = $contact["id"];
// Update the contact every 7 days
@ -790,25 +790,25 @@ class Contact extends BaseObject
// Get data from the gcontact table
$fields = ['name', 'nick', 'url', 'photo', 'addr', 'alias', 'network'];
$contact = DBA::selectFirst('gcontact', $fields, ['nurl' => normalise_link($url)]);
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
$contact = DBA::selectFirst('contact', $fields, ['nurl' => normalise_link($url)]);
}
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
$fields = ['url', 'addr', 'alias', 'notify', 'poll', 'name', 'nick',
'photo', 'keywords', 'location', 'about', 'network',
'priority', 'batch', 'request', 'confirm', 'poco'];
$contact = DBA::selectFirst('contact', $fields, ['addr' => $url]);
}
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
// The link could be provided as http although we stored it as https
$ssl_url = str_replace('http://', 'https://', $url);
$condition = ['alias' => [$url, normalise_link($url), $ssl_url]];
$contact = DBA::selectFirst('contact', $fields, $condition);
}
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
$fields = ['url', 'addr', 'alias', 'notify', 'poll', 'name', 'nick',
'photo', 'network', 'priority', 'batch', 'request', 'confirm'];
$condition = ['url' => [$url, normalise_link($url), $ssl_url]];
@ -819,7 +819,7 @@ class Contact extends BaseObject
$contact = $default;
}
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
return 0;
} else {
$data = array_merge($data, $contact);
@ -866,7 +866,7 @@ class Contact extends BaseObject
$s = DBA::select('contact', ['id'], ['nurl' => normalise_link($data["url"]), 'uid' => $uid], ['order' => ['id'], 'limit' => 2]);
$contacts = DBA::toArray($s);
if (!DBA::is_result($contacts)) {
if (!DBA::isResult($contacts)) {
return 0;
}
@ -874,7 +874,7 @@ class Contact extends BaseObject
// Update the newly created contact from data in the gcontact table
$gcontact = DBA::selectFirst('gcontact', ['location', 'about', 'keywords', 'gender'], ['nurl' => normalise_link($data["url"])]);
if (DBA::is_result($gcontact)) {
if (DBA::isResult($gcontact)) {
// Only use the information when the probing hadn't fetched these values
if ($data['keywords'] != '') {
unset($gcontact['keywords']);
@ -900,7 +900,7 @@ class Contact extends BaseObject
$contact = DBA::selectFirst('contact', $fields, ['id' => $contact_id]);
// This condition should always be true
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
return $contact_id;
}
@ -971,7 +971,7 @@ class Contact extends BaseObject
}
$blocked = DBA::selectFirst('contact', ['blocked'], ['id' => $cid]);
if (!DBA::is_result($blocked)) {
if (!DBA::isResult($blocked)) {
return false;
}
return (bool) $blocked['blocked'];
@ -991,7 +991,7 @@ class Contact extends BaseObject
}
$hidden = DBA::selectFirst('contact', ['hidden'], ['id' => $cid]);
if (!DBA::is_result($hidden)) {
if (!DBA::isResult($hidden)) {
return false;
}
return (bool) $hidden['hidden'];
@ -1017,7 +1017,7 @@ class Contact extends BaseObject
dbesc(normalise_link($contact_url))
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return '';
}
@ -1137,7 +1137,7 @@ class Contact extends BaseObject
public static function updateAvatar($avatar, $uid, $cid, $force = false)
{
$contact = DBA::selectFirst('contact', ['avatar', 'photo', 'thumb', 'micro', 'nurl'], ['id' => $cid]);
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
return false;
} else {
$data = [$contact["photo"], $contact["thumb"], $contact["micro"]];
@ -1156,7 +1156,7 @@ class Contact extends BaseObject
// Update the public contact (contact id = 0)
if ($uid != 0) {
$pcontact = DBA::selectFirst('contact', ['id'], ['nurl' => $contact['nurl'], 'uid' => 0]);
if (DBA::is_result($pcontact)) {
if (DBA::isResult($pcontact)) {
self::updateAvatar($avatar, 0, $pcontact['id'], $force);
}
}
@ -1181,7 +1181,7 @@ class Contact extends BaseObject
$fields = ['url', 'nurl', 'addr', 'alias', 'batch', 'notify', 'poll', 'poco', 'network'];
$contact = DBA::selectFirst('contact', $fields, ['id' => $id]);
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
return false;
}
@ -1302,7 +1302,7 @@ class Contact extends BaseObject
dbesc($ret['network'])
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `network` = '%s' AND NOT `pending` LIMIT 1",
intval($uid),
dbesc(normalise_link($url)),
@ -1310,7 +1310,7 @@ class Contact extends BaseObject
);
}
if (($ret['network'] === NETWORK_DFRN) && !DBA::is_result($r)) {
if (($ret['network'] === NETWORK_DFRN) && !DBA::isResult($r)) {
if ($interactive) {
if (strlen($a->urlpath)) {
$myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']);
@ -1372,7 +1372,7 @@ class Contact extends BaseObject
$writeable = 1;
}
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
// update contact
$new_relation = (($r[0]['rel'] == CONTACT_IS_FOLLOWER) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING);
@ -1409,7 +1409,7 @@ class Contact extends BaseObject
}
$contact = DBA::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
$result['message'] .= L10n::t('Unable to retrieve contact information.') . EOL;
return $result;
}
@ -1431,7 +1431,7 @@ class Contact extends BaseObject
intval($uid)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DFRN])) {
// create a follow slap
$item = [];
@ -1540,7 +1540,7 @@ class Contact extends BaseObject
/// @TODO Encapsulate this into a function/method
$fields = ['uid', 'username', 'email', 'page-flags', 'notify-flags', 'language'];
$user = DBA::selectFirst('user', $fields, ['uid' => $importer['uid']]);
if (DBA::is_result($user) && !in_array($user['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
if (DBA::isResult($user) && !in_array($user['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
// create notification
$hash = random_string();
@ -1571,7 +1571,7 @@ class Contact extends BaseObject
]);
}
} elseif (DBA::is_result($user) && in_array($user['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
} elseif (DBA::isResult($user) && in_array($user['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
q("UPDATE `contact` SET `pending` = 0 WHERE `uid` = %d AND `url` = '%s' AND `pending` LIMIT 1",
intval($importer['uid']),
dbesc($url)
@ -1609,7 +1609,7 @@ class Contact extends BaseObject
// In-network birthdays are handled within local_delivery
$r = q("SELECT * FROM `contact` WHERE `bd` != '' AND `bd` > '0001-01-01' AND SUBSTRING(`bd`, 1, 4) != `bdyear` ");
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
foreach ($r as $rr) {
logger('update_contact_birthday: ' . $rr['bd']);
@ -1627,7 +1627,7 @@ class Contact extends BaseObject
$s = q("SELECT `id` FROM `event` WHERE `uid` = %d AND `cid` = %d AND `start` = '%s' AND `type` = '%s' LIMIT 1",
intval($rr['uid']), intval($rr['id']), dbesc(DateTimeFormat::utc($nextbd)), dbesc('birthday'));
if (DBA::is_result($s)) {
if (DBA::isResult($s)) {
continue;
}

View file

@ -54,7 +54,7 @@ class Conversation
$fields = ['item-uri', 'reply-to-uri', 'conversation-uri', 'conversation-href', 'protocol', 'source'];
$old_conv = DBA::selectFirst('conversation', $fields, ['item-uri' => $conversation['item-uri']]);
if (DBA::is_result($old_conv)) {
if (DBA::isResult($old_conv)) {
// Don't update when only the source has changed.
// Only do this when there had been no source before.
if ($old_conv['source'] != '') {

View file

@ -266,11 +266,11 @@ class Event extends BaseObject
if ($event['id']) {
// has the event actually changed?
$existing_event = DBA::selectFirst('event', ['edited'], ['id' => $event['id'], 'uid' => $event['uid']]);
if (!DBA::is_result($existing_event) || ($existing_event['edited'] === $event['edited'])) {
if (!DBA::isResult($existing_event) || ($existing_event['edited'] === $event['edited'])) {
$item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
return DBA::is_result($item) ? $item['id'] : 0;
return DBA::isResult($item) ? $item['id'] : 0;
}
$updated_fields = [
@ -288,7 +288,7 @@ class Event extends BaseObject
DBA::update('event', $updated_fields, ['id' => $event['id'], 'uid' => $event['uid']]);
$item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
$object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($event['uri']) . '</id>';
$object .= '<content>' . xmlify(self::getBBCode($event)) . '</content>';
$object .= '</object>' . "\n";
@ -469,7 +469,7 @@ class Event extends BaseObject
intval($event_id)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$return = self::removeDuplicates($r);
}
@ -518,7 +518,7 @@ class Event extends BaseObject
dbesc($event_params["adjust_finish"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$return = self::removeDuplicates($r);
}
@ -539,7 +539,7 @@ class Event extends BaseObject
$fmt = L10n::t('l, F j');
foreach ($event_result as $event) {
$item = Item::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link'], ['id' => $event['itemid']]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
$event = array_merge($event, $item);
}
@ -737,7 +737,7 @@ class Event extends BaseObject
}
$events = DBA::select('event', $fields, $conditions);
if (DBA::is_result($events)) {
if (DBA::isResult($events)) {
$return = DBA::toArray($events);
}
@ -761,7 +761,7 @@ class Event extends BaseObject
$process = false;
$user = DBA::selectFirst('user', ['timezone'], ['uid' => $uid]);
if (DBA::is_result($user)) {
if (DBA::isResult($user)) {
$timezone = $user['timezone'];
}

View file

@ -105,7 +105,7 @@ class GContact
intval($zcid)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
q(
"INSERT INTO `glink` (`cid`, `uid`, `gcid`, `zcid`, `updated`) VALUES (%d, %d, %d, %d, '%s') ",
intval($cid),
@ -179,7 +179,7 @@ class GContact
dbesc(normalise_link($gcontact['url'])),
dbesc(NETWORK_STATUSNET)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$gcontact['network'] = $r[0]["network"];
}
@ -190,7 +190,7 @@ class GContact
dbesc(normalise_link($gcontact['url'])),
dbesc(NETWORK_STATUSNET)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$gcontact['network'] = $r[0]["network"];
}
}
@ -204,7 +204,7 @@ class GContact
dbesc(normalise_link($gcontact['url']))
);
if (DBA::is_result($x)) {
if (DBA::isResult($x)) {
if (!isset($gcontact['network']) && ($x[0]["network"] != NETWORK_STATUSNET)) {
$gcontact['network'] = $x[0]["network"];
}
@ -289,7 +289,7 @@ class GContact
);
// logger("countCommonFriends: $uid $cid {$r[0]['total']}");
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $r[0]['total'];
}
return 0;
@ -311,7 +311,7 @@ class GContact
intval($uid)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $r[0]['total'];
}
@ -352,7 +352,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
return $r;
}
@ -384,7 +384,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
return $r;
}
@ -404,7 +404,7 @@ class GContact
intval($uid)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $r[0]['total'];
}
@ -435,7 +435,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
return $r;
}
@ -495,7 +495,7 @@ class GContact
intval($limit)
);
if (DBA::is_result($r) && count($r) >= ($limit -1)) {
if (DBA::isResult($r) && count($r) >= ($limit -1)) {
/*
* Uncommented because the result of the queries are to big to store it in the cache.
* We need to decide if we want to change the db column type or if we want to delete it.
@ -584,7 +584,7 @@ class GContact
dbesc(NETWORK_DIASPORA)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$base = substr($rr['poco'], 0, strrpos($rr['poco'], '/'));
if (! in_array($base, $done)) {
@ -693,7 +693,7 @@ class GContact
dbesc(normalise_link($contact["url"]))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$gcontact_id = $r[0]["id"];
// Update every 90 days
@ -728,7 +728,7 @@ class GContact
dbesc(normalise_link($contact["url"]))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$gcontact_id = $r[0]["id"];
$doprobing = in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""]);
@ -877,7 +877,7 @@ class GContact
/// @todo Check if we really should do this.
// The quality of the gcontact table is mostly lower than the public contact
$public_contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link($contact["url"]), 'uid' => 0]);
if (DBA::is_result($public_contact)) {
if (DBA::isResult($public_contact)) {
logger("Update public contact ".$public_contact["id"], LOGGER_DEBUG);
Contact::updateAvatar($contact["photo"], 0, $public_contact["id"]);
@ -1052,7 +1052,7 @@ class GContact
dbesc($last_update)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return;
}
@ -1075,7 +1075,7 @@ class GContact
dbesc(NETWORK_DFRN)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return dirname($r[0]['url']);
}

View file

@ -38,7 +38,7 @@ class Group extends BaseObject
// access lists. What we're doing here is reviving the dead group, but old content which
// was restricted to this group may now be seen by the new group members.
$group = DBA::selectFirst('group', ['deleted'], ['id' => $gid]);
if (DBA::is_result($group) && $group['deleted']) {
if (DBA::isResult($group) && $group['deleted']) {
DBA::update('group', ['deleted' => 0], ['id' => $gid]);
notice(L10n::t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
}
@ -132,7 +132,7 @@ class Group extends BaseObject
}
$group = DBA::selectFirst('group', ['id'], ['uid' => $uid, 'name' => $name]);
if (DBA::is_result($group)) {
if (DBA::isResult($group)) {
return $group['id'];
}
@ -151,13 +151,13 @@ class Group extends BaseObject
}
$group = DBA::selectFirst('group', ['uid'], ['id' => $gid]);
if (!DBA::is_result($group)) {
if (!DBA::isResult($group)) {
return false;
}
// remove group from default posting lists
$user = DBA::selectFirst('user', ['def_gid', 'allow_gid', 'deny_gid'], ['uid' => $group['uid']]);
if (DBA::is_result($user)) {
if (DBA::isResult($user)) {
$change = false;
if ($user['def_gid'] == $gid) {

View file

@ -818,7 +818,7 @@ class Item extends BaseObject
// Fetch the uri-hash from an existing item entry if there is one
$item_condition = ["`uri` = ? AND `uri-hash` != ''", $item['uri']];
$existing = DBA::selectfirst('item', ['uri-hash'], $item_condition);
if (DBA::is_result($existing)) {
if (DBA::isResult($existing)) {
$item['uri-hash'] = $existing['uri-hash'];
} else {
$item['uri-hash'] = self::itemHash($item['uri'], $item['created']);
@ -839,7 +839,7 @@ class Item extends BaseObject
if (empty($item['iaid'])) {
$item_activity = DBA::selectFirst('item-activity', ['id'], ['uri-hash' => $item['uri-hash']]);
if (DBA::is_result($item_activity)) {
if (DBA::isResult($item_activity)) {
$item_fields = ['iaid' => $item_activity['id'], 'icid' => null];
foreach (self::MIXED_CONTENT_FIELDLIST as $field) {
if (self::isLegacyMode()) {
@ -871,7 +871,7 @@ class Item extends BaseObject
if (empty($item['icid'])) {
$item_content = DBA::selectFirst('item-content', [], ['uri-plink-hash' => $item['uri-hash']]);
if (DBA::is_result($item_content)) {
if (DBA::isResult($item_content)) {
$item_fields = ['icid' => $item_content['id']];
// Clear all fields in the item table that have a content in the item-content table
foreach ($item_content as $field => $content) {
@ -974,7 +974,7 @@ class Item extends BaseObject
'deleted', 'file', 'resource-id', 'event-id', 'attach',
'verb', 'object-type', 'object', 'target', 'contact-id'];
$item = self::selectFirst($fields, ['id' => $item_id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger('Item with ID ' . $item_id . " hasn't been found.", LOGGER_DEBUG);
return false;
}
@ -985,7 +985,7 @@ class Item extends BaseObject
}
$parent = self::selectFirst(['origin'], ['id' => $item['parent']]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
$parent = ['origin' => false];
}
@ -1069,7 +1069,7 @@ class Item extends BaseObject
// When we delete just our local user copy of an item, we have to set a marker to hide it
$global_item = self::selectFirst(['id'], ['uri' => $item['uri'], 'uid' => 0, 'deleted' => false]);
if (DBA::is_result($global_item)) {
if (DBA::isResult($global_item)) {
DBA::update('user-item', ['hidden' => true], ['iid' => $global_item['id'], 'uid' => $item['uid']], true);
}
}
@ -1093,7 +1093,7 @@ class Item extends BaseObject
}
$i = self::selectFirst(['id', 'contact-id', 'tag'], ['uri' => $xt->id, 'uid' => $item['uid']]);
if (!DBA::is_result($i)) {
if (!DBA::isResult($i)) {
return;
}
@ -1194,7 +1194,7 @@ class Item extends BaseObject
// Still missing? Then use the "self" contact of the current user
if ($contact_id == 0) {
$self = DBA::selectFirst('contact', ['id'], ['self' => true, 'uid' => $item['uid']]);
if (DBA::is_result($self)) {
if (DBA::isResult($self)) {
$contact_id = $self["id"];
}
}
@ -1290,7 +1290,7 @@ class Item extends BaseObject
$expire_interval = Config::get('system', 'dbclean-expire-days', 0);
$user = DBA::selectFirst('user', ['expire'], ['uid' => $uid]);
if (DBA::is_result($user) && ($user['expire'] > 0) && (($user['expire'] < $expire_interval) || ($expire_interval == 0))) {
if (DBA::isResult($user) && ($user['expire'] > 0) && (($user['expire'] < $expire_interval) || ($expire_interval == 0))) {
$expire_interval = $user['expire'];
}
@ -1313,7 +1313,7 @@ class Item extends BaseObject
trim($item['uri']), $item['uid'],
NETWORK_DIASPORA, NETWORK_DFRN, NETWORK_OSTATUS];
$existing = self::selectFirst(['id', 'network'], $condition);
if (DBA::is_result($existing)) {
if (DBA::isResult($existing)) {
// We only log the entries with a different user id than 0. Otherwise we would have too many false positives
if ($uid != 0) {
logger("Item with uri ".$item['uri']." already existed for user ".$uid." with id ".$existing["id"]." target network ".$existing["network"]." - new network: ".$item['network']);
@ -1325,7 +1325,7 @@ class Item extends BaseObject
// Ensure to always have the same creation date.
$existing = DBA::selectfirst('item', ['created', 'uri-hash'], ['uri' => $item['uri']]);
if (DBA::is_result($existing)) {
if (DBA::isResult($existing)) {
$item['created'] = $existing['created'];
$item['uri-hash'] = $existing['uri-hash'];
}
@ -1472,7 +1472,7 @@ class Item extends BaseObject
$params = ['order' => ['id' => false]];
$parent = self::selectFirst($fields, $condition, $params);
if (DBA::is_result($parent)) {
if (DBA::isResult($parent)) {
// is the new message multi-level threaded?
// even though we don't support it now, preserve the info
// and re-attach to the conversation parent.
@ -1486,7 +1486,7 @@ class Item extends BaseObject
$params = ['order' => ['id' => false]];
$toplevel_parent = self::selectFirst($fields, $condition, $params);
if (DBA::is_result($toplevel_parent)) {
if (DBA::isResult($toplevel_parent)) {
$parent = $toplevel_parent;
}
}
@ -1521,7 +1521,7 @@ class Item extends BaseObject
// If its a post from myself then tag the thread as "mention"
logger("Checking if parent ".$parent_id." has to be tagged as mention for user ".$item['uid'], LOGGER_DEBUG);
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $item['uid']]);
if (DBA::is_result($user)) {
if (DBA::isResult($user)) {
$self = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']);
$self_id = Contact::getIdForURL($self, 0, true);
logger("'myself' is ".$self_id." for parent ".$parent_id." checking against ".$item['author-id']." and ".$item['owner-id'], LOGGER_DEBUG);
@ -1666,7 +1666,7 @@ class Item extends BaseObject
$ret = DBA::insert('item', $item);
// When the item was successfully stored we fetch the ID of the item.
if (DBA::is_result($ret)) {
if (DBA::isResult($ret)) {
$current_post = DBA::lastInsertId();
} else {
// This can happen - for example - if there are locking timeouts.
@ -1771,7 +1771,7 @@ class Item extends BaseObject
*/
if (!$deleted && !$dontcache) {
$posted_item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $current_post]);
if (DBA::is_result($posted_item)) {
if (DBA::isResult($posted_item)) {
if ($notify) {
Addon::callHooks('post_local_end', $posted_item);
} else {
@ -1881,7 +1881,7 @@ class Item extends BaseObject
// Do we already have this content?
$item_activity = DBA::selectFirst('item-activity', ['id'], ['uri-hash' => $item['uri-hash']]);
if (DBA::is_result($item_activity)) {
if (DBA::isResult($item_activity)) {
$item['iaid'] = $item_activity['id'];
logger('Fetched activity for URI ' . $item['uri'] . ' (' . $item['iaid'] . ')');
} elseif (DBA::insert('item-activity', $fields)) {
@ -1922,7 +1922,7 @@ class Item extends BaseObject
// Do we already have this content?
$item_content = DBA::selectFirst('item-content', ['id'], ['uri-plink-hash' => $item['uri-hash']]);
if (DBA::is_result($item_content)) {
if (DBA::isResult($item_content)) {
$item['icid'] = $item_content['id'];
logger('Fetched content for URI ' . $item['uri'] . ' (' . $item['icid'] . ')');
} elseif (DBA::insert('item-content', $fields)) {
@ -2000,7 +2000,7 @@ class Item extends BaseObject
{
$condition = ["`id` IN (SELECT `parent` FROM `item` WHERE `id` = ?)", $itemid];
$parent = self::selectFirst(['owner-id'], $condition);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
return;
}
@ -2009,7 +2009,7 @@ class Item extends BaseObject
'network' => [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""],
'visible' => true, 'deleted' => false, 'moderated' => false, 'private' => false];
$item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $itemid]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -2071,7 +2071,7 @@ class Item extends BaseObject
if (empty($item['contact-id'])) {
$self = DBA::selectFirst('contact', ['id'], ['self' => true, 'uid' => $uid]);
if (!DBA::is_result($self)) {
if (!DBA::isResult($self)) {
return;
}
$item['contact-id'] = $self['id'];
@ -2082,7 +2082,7 @@ class Item extends BaseObject
$notify = false;
if ($item['uri'] == $item['parent-uri']) {
$contact = DBA::selectFirst('contact', [], ['id' => $item['contact-id'], 'self' => false]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$notify = self::isRemoteSelf($contact, $item);
}
}
@ -2111,7 +2111,7 @@ class Item extends BaseObject
$condition = ['id' => $itemid, 'parent' => [0, $itemid]];
$item = self::selectFirst($fields, $condition);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -2136,7 +2136,7 @@ class Item extends BaseObject
$item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $itemid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
// Preparing public shadow (removing user specific data)
$item['uid'] = 0;
unset($item['id']);
@ -2169,7 +2169,7 @@ class Item extends BaseObject
public static function addShadowPost($itemid)
{
$item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $itemid]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -2302,13 +2302,13 @@ class Item extends BaseObject
{
// Unarchive the author
$contact = DBA::selectFirst('contact', [], ['id' => $arr["author-id"]]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
Contact::unmarkForArchival($contact);
}
// Unarchive the contact if it's not our own contact
$contact = DBA::selectFirst('contact', [], ['id' => $arr["contact-id"], 'self' => false]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
Contact::unmarkForArchival($contact);
}
@ -2408,7 +2408,7 @@ class Item extends BaseObject
public static function getGuidById($id)
{
$item = self::selectFirst(['guid'], ['id' => $id]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
return $item['guid'];
} else {
return '';
@ -2430,7 +2430,7 @@ class Item extends BaseObject
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND `item`.`guid` = ? AND `item`.`uid` = ?", $guid, $uid);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
$id = $item["id"];
$nick = $item["nickname"];
}
@ -2443,7 +2443,7 @@ class Item extends BaseObject
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND NOT `item`.`private` AND `item`.`wall`
AND `item`.`guid` = ?", $guid);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
$id = $item["id"];
$nick = $item["nickname"];
}
@ -2462,7 +2462,7 @@ class Item extends BaseObject
$mention = false;
$user = DBA::selectFirst('user', [], ['uid' => $uid]);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return;
}
@ -2470,7 +2470,7 @@ class Item extends BaseObject
$prvgroup = (($user['page-flags'] == PAGE_PRVGROUP) ? true : false);
$item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -2523,7 +2523,7 @@ class Item extends BaseObject
// now change this copy of the post to a forum head message and deliver to all the tgroup members
$self = DBA::selectFirst('contact', ['id', 'name', 'url', 'thumb'], ['uid' => $uid, 'self' => true]);
if (!DBA::is_result($self)) {
if (!DBA::isResult($self)) {
return;
}
@ -2581,7 +2581,7 @@ class Item extends BaseObject
if ($contact['remote_self'] == 2) {
$self = DBA::selectFirst('contact', ['id', 'name', 'url', 'thumb'],
['uid' => $contact['uid'], 'self' => true]);
if (DBA::is_result($self)) {
if (DBA::isResult($self)) {
$datarray['contact-id'] = $self["id"];
$datarray['owner-name'] = $self["name"];
@ -2675,7 +2675,7 @@ class Item extends BaseObject
$i = substr($i, 0, $x);
$fields = ['data', 'type', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
$photo = DBA::selectFirst('photo', $fields, ['resource-id' => $i, 'scale' => $res, 'uid' => $uid]);
if (DBA::is_result($photo)) {
if (DBA::isResult($photo)) {
/*
* Check to see if we should replace this photo link with an embedded image
* 1. No need to do so if the photo is public
@ -2840,7 +2840,7 @@ class Item extends BaseObject
$items = self::select(['file', 'resource-id', 'starred', 'type', 'id'], $condition);
if (!DBA::is_result($items)) {
if (!DBA::isResult($items)) {
return;
}
@ -2889,7 +2889,7 @@ class Item extends BaseObject
$condition = ['uid' => $uid, 'wall' => $wall, 'deleted' => false, 'visible' => true, 'moderated' => false];
$params = ['order' => ['created' => false]];
$thread = DBA::selectFirst('thread', ['created'], $condition, $params);
if (DBA::is_result($thread)) {
if (DBA::isResult($thread)) {
return substr(DateTimeFormat::local($thread['created']), 0, 10);
}
return false;
@ -2947,7 +2947,7 @@ class Item extends BaseObject
logger('like: verb ' . $verb . ' item ' . $item_id);
$item = self::selectFirst(self::ITEM_FIELDLIST, ['`id` = ? OR `uri` = ?', $item_id, $item_id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger('like: unknown item ' . $item_id);
return false;
}
@ -2966,7 +2966,7 @@ class Item extends BaseObject
// Retrieves the local post owner
$owner_self_contact = DBA::selectFirst('contact', [], ['uid' => $uid, 'self' => true]);
if (!DBA::is_result($owner_self_contact)) {
if (!DBA::isResult($owner_self_contact)) {
logger('like: unknown owner ' . $uid);
return false;
}
@ -2975,7 +2975,7 @@ class Item extends BaseObject
$author_id = public_contact();
$author_contact = DBA::selectFirst('contact', ['url'], ['id' => $author_id]);
if (!DBA::is_result($author_contact)) {
if (!DBA::isResult($author_contact)) {
logger('like: unknown author ' . $author_id);
return false;
}
@ -2987,7 +2987,7 @@ class Item extends BaseObject
} else {
$item_contact_id = Contact::getIdForURL($author_contact['url'], $uid, true);
$item_contact = DBA::selectFirst('contact', [], ['id' => $item_contact_id]);
if (!DBA::is_result($item_contact)) {
if (!DBA::isResult($item_contact)) {
logger('like: unknown item contact ' . $item_contact_id);
return false;
}
@ -3014,7 +3014,7 @@ class Item extends BaseObject
$like_item = self::selectFirst(['id', 'guid', 'verb'], $condition);
// If it exists, mark it as deleted
if (DBA::is_result($like_item)) {
if (DBA::isResult($like_item)) {
// Already voted, undo it
$fields = ['deleted' => true, 'unseen' => true, 'changed' => DateTimeFormat::utcNow()];
/// @todo Consider using self::update - but before doing so, check the side effects
@ -3089,7 +3089,7 @@ class Item extends BaseObject
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$item = self::selectFirst($fields, $condition);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -3110,7 +3110,7 @@ class Item extends BaseObject
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$item = self::selectFirst($fields, $condition);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return;
}
@ -3136,7 +3136,7 @@ class Item extends BaseObject
private static function deleteThread($itemid, $itemuri = "")
{
$item = DBA::selectFirst('thread', ['uid'], ['iid' => $itemid]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger('No thread found for id '.$itemid, LOGGER_DEBUG);
return;
}

View file

@ -61,7 +61,7 @@ class Mail
dbesc($replyto),
dbesc($replyto)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$convid = $r[0]['convid'];
}
}

View file

@ -49,7 +49,7 @@ class OpenWebAuthToken
$condition = ["type" => $type, "uid" => $uid, "token" => $token];
$entry = DBA::selectFirst("openwebauth-token", ["id", "meta"], $condition);
if (DBA::is_result($entry)) {
if (DBA::isResult($entry)) {
DBA::delete("openwebauth-token", ["id" => $entry["id"]]);
return $entry["meta"];

View file

@ -30,7 +30,7 @@ class PermissionSet extends BaseObject
$set = DBA::selectFirst('permissionset', ['id'], $condition);
if (!DBA::is_result($set)) {
if (!DBA::isResult($set)) {
DBA::insert('permissionset', $condition, true);
$set = DBA::selectFirst('permissionset', ['id'], $condition);

View file

@ -41,7 +41,7 @@ class Photo
public static function store(Image $Image, $uid, $cid, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '', $desc = '')
{
$photo = DBA::selectFirst('photo', ['guid'], ["`resource-id` = ? AND `guid` != ?", $rid, '']);
if (DBA::is_result($photo)) {
if (DBA::isResult($photo)) {
$guid = $photo['guid'];
} else {
$guid = System::createGUID();
@ -72,7 +72,7 @@ class Photo
'desc' => $desc
];
if (DBA::is_result($existing_photo)) {
if (DBA::isResult($existing_photo)) {
$r = DBA::update('photo', $fields, ['id' => $existing_photo['id']]);
} else {
$r = DBA::insert('photo', $fields);

View file

@ -90,7 +90,7 @@ class Profile
{
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
if (!DBA::is_result($user) && empty($profiledata)) {
if (!DBA::isResult($user) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404;
@ -101,7 +101,7 @@ class Profile
// Add profile data to sidebar
$a->page['aside'] .= self::sidebar($profiledata, true, $show_connect);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return;
}
}
@ -198,7 +198,7 @@ class Profile
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $uid) {
$contact = DBA::selectFirst('contact', ['profile-id'], ['id' => $visitor['cid']]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$profile_id = $contact['profile-id'];
}
break;
@ -222,7 +222,7 @@ class Profile
intval($profile_id)
);
}
if (!DBA::is_result($profile)) {
if (!DBA::isResult($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`,
@ -374,7 +374,7 @@ class Profile
'entries' => [],
];
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
@ -452,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 (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$updated = date('c', strtotime($r[0]['updated']));
}
@ -467,7 +467,7 @@ class Profile
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contacts = intval($r[0]['total']);
}
}
@ -555,7 +555,7 @@ class Profile
DateTimeFormat::utc('now + 6 days'),
DateTimeFormat::utcNow()
);
if (DBA::is_result($s)) {
if (DBA::isResult($s)) {
$r = DBA::toArray($s);
Cache::set($cachekey, $r, CACHE_HOUR);
}
@ -563,7 +563,7 @@ class Profile
$total = 0;
$classtoday = '';
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$now = strtotime('now');
$cids = [];
@ -657,7 +657,7 @@ class Profile
$r = [];
if (DBA::is_result($s)) {
if (DBA::isResult($s)) {
$istoday = false;
while ($rr = DBA::fetch($s)) {
@ -1026,7 +1026,7 @@ class Profile
$contact = DBA::selectFirst('contact',['id', 'url'], ['id' => $cid]);
if (DBA::is_result($contact) && remote_user() && remote_user() == $contact['id']) {
if (DBA::isResult($contact) && remote_user() && remote_user() == $contact['id']) {
// The visitor is already authenticated.
return;
}

View file

@ -73,7 +73,7 @@ class PushSubscriber
if ($subscribe) {
// if we are just updating an old subscription, keep the
// old values for last_update but reset the push
if (DBA::is_result($subscriber)) {
if (DBA::isResult($subscriber)) {
$last_update = $subscriber['last_update'];
$push_flag = min($subscriber['push'], 1);
} else {
@ -103,7 +103,7 @@ class PushSubscriber
public static function delay($id)
{
$subscriber = DBA::selectFirst('push_subscriber', ['push', 'callback_url', 'renewed', 'nickname'], ['id' => $id]);
if (!DBA::is_result($subscriber)) {
if (!DBA::isResult($subscriber)) {
return;
}
@ -141,7 +141,7 @@ class PushSubscriber
public static function reset($id, $last_update)
{
$subscriber = DBA::selectFirst('push_subscriber', ['callback_url', 'nickname'], ['id' => $id]);
if (!DBA::is_result($subscriber)) {
if (!DBA::isResult($subscriber)) {
return;
}

View file

@ -19,7 +19,7 @@ class Queue
{
logger('queue: requeue item ' . $id);
$queue = DBA::selectFirst('queue', ['retrial'], ['id' => $id]);
if (!DBA::is_result($queue)) {
if (!DBA::isResult($queue)) {
return;
}
@ -60,7 +60,7 @@ class Queue
intval($cid)
);
$was_delayed = DBA::is_result($r);
$was_delayed = DBA::isResult($r);
// We set "term-date" to a current date if the communication has problems.
// If the communication works again we reset this value.
@ -68,7 +68,7 @@ class Queue
$r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND `term-date` <= '1000-01-01' LIMIT 1",
intval($cid)
);
$was_delayed = !DBA::is_result($r);
$was_delayed = !DBA::isResult($r);
}
return $was_delayed;
@ -98,7 +98,7 @@ class Queue
intval($cid)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
if ($batch && ($r[0]['total'] > $batch_queue)) {
logger('too many queued items for batch server ' . $cid . ' - discarding message');
return;

View file

@ -58,7 +58,7 @@ class Term
$fields = ['guid', 'uid', 'id', 'edited', 'deleted', 'created', 'received', 'title', 'body', 'parent'];
$message = Item::selectFirst($fields, ['id' => $itemid]);
if (!DBA::is_result($message)) {
if (!DBA::isResult($message)) {
return;
}
@ -166,7 +166,7 @@ class Term
public static function insertFromFileFieldByItemId($itemid, $files)
{
$message = Item::selectFirst(['uid', 'deleted'], ['id' => $itemid]);
if (!DBA::is_result($message)) {
if (!DBA::isResult($message)) {
return;
}

View file

@ -55,7 +55,7 @@ class User
LIMIT 1",
$uid
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return false;
}
return $r;
@ -70,7 +70,7 @@ class User
public static function getOwnerDataByNick($nick)
{
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nick]);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return false;
}
return self::getOwnerDataById($user['uid']);
@ -98,7 +98,7 @@ class User
$user = DBA::selectFirst('user', ['def_gid'], ['uid' => $uid]);
if (DBA::is_result($user)) {
if (DBA::isResult($user)) {
$default_group = $user["def_gid"];
}
@ -214,7 +214,7 @@ class User
$user = DBA::selectFirst('user', $fields, $condition);
}
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
throw new Exception(L10n::t('User not found'));
}
}