Replace dba::select(limit => 1) by dba::selectOne

- Convert array declarations to new style
This commit is contained in:
Hypolite Petovan 2018-01-09 22:20:33 -05:00
parent a2d3cee006
commit da60893590
51 changed files with 206 additions and 219 deletions

View file

@ -580,8 +580,8 @@ function networkThreadedView(App $a, $update = 0) {
if ($cid) {
// If $cid belongs to a communitity forum or a privat goup,.add a mention to the status editor
$condition = array("`id` = ? AND (`forum` OR `prv`)", $cid);
$contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1));
$condition = ["`id` = ? AND (`forum` OR `prv`)", $cid];
$contact = dba::selectOne('contact', ['addr', 'nick'], $condition);
if (DBM::is_result($contact)) {
if ($contact["addr"] != '') {
$content = "!".$contact["addr"];
@ -632,7 +632,7 @@ function networkThreadedView(App $a, $update = 0) {
$sql_nets = (($nets) ? sprintf(" and $sql_table.`network` = '%s' ", dbesc($nets)) : '');
if ($group) {
$r = dba::select('group', array('name'), array('id' => $group, 'uid' => $_SESSION['uid']), array('limit' => 1));
$r = dba::selectOne('group', ['name'], ['id' => $group, 'uid' => $_SESSION['uid']]);
if (!DBM::is_result($r)) {
if ($update)
killme();
@ -647,7 +647,7 @@ function networkThreadedView(App $a, $update = 0) {
$contact_str_self = "";
$contact_str = implode(',',$contacts);
$self = dba::select('contact', array('id'), array('uid' => $_SESSION['uid'], 'self' => true), array('limit' => 1));
$self = dba::selectOne('contact', ['id'], ['uid' => $_SESSION['uid'], 'self' => true]);
if (DBM::is_result($self)) {
$contact_str_self = $self["id"];
}
@ -665,10 +665,10 @@ function networkThreadedView(App $a, $update = 0) {
)) . $o;
} elseif ($cid) {
$fields = array('id', 'name', 'network', 'writable', 'nurl',
'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location');
$condition = array("`id` = ? AND (NOT `blocked` OR `pending`)", $cid);
$r = dba::select('contact', $fields, $condition, array('limit' => 1));
$fields = ['id', 'name', 'network', 'writable', 'nurl',
'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location'];
$condition = ["`id` = ? AND (NOT `blocked` OR `pending`)", $cid];
$r = dba::selectOne('contact', $fields, $condition);
if (DBM::is_result($r)) {
$sql_extra = " AND ".$sql_table.".`contact-id` = ".intval($cid);