}
$condition = ['verb' => ACTIVITY_LIKE, 'uid' => $uid, 'contact-id' => $contactid, 'thr-parent' => $orig_post['uri']];
- if (DBA::exists('item', $condition)) {
+ if (Item::exists($condition)) {
logger("pumpio_dolike: found existing like. User ".$own_id." ".$uid." Contact: ".$contactid." Url ".$orig_post['uri']);
return;
}
{
// Two queries for speed issues
$condition = ['uri' => $post->object->id, 'uid' => $uid];
- if (DBA::exists('item', $condition)) {
+ if (Item::exists($condition)) {
Item::delete($condition);
return true;
}
$condition = ['extid' => $post->object->id, 'uid' => $uid];
- if (DBA::exists('item', $condition)) {
+ if (Item::exists($condition)) {
Item::delete($condition);
return true;
}
if ($post->verb != "update") {
// Two queries for speed issues
- if (DBA::exists('item', ['uri' => $post->object->id, 'uid' => $uid])) {
+ if (Item::exists(['uri' => $post->object->id, 'uid' => $uid])) {
return false;
}
- if (DBA::exists('item', ['extid' => $post->object->id, 'uid' => $uid])) {
+ if (Item::exists(['extid' => $post->object->id, 'uid' => $uid])) {
return false;
}
}
}
// Checking if the comment already exists - Two queries for speed issues
- if (DBA::exists('item', ['uri' => $item->id, 'uid' => $uid])) {
+ if (Item::exists(['uri' => $item->id, 'uid' => $uid])) {
continue;
}
- if (DBA::exists('item', ['extid' => $item->id, 'uid' => $uid])) {
+ if (Item::exists(['extid' => $item->id, 'uid' => $uid])) {
continue;
}
return;
}
- $r = DBA::select('item', ['id', 'iaid', 'icid'], ['deleted' => true, 'network' => Protocol::TWITTER]);
+ $r = Item::select(['id'], ['deleted' => true, 'network' => Protocol::TWITTER]);
while ($row = DBA::fetch($r)) {
DBA::delete('item', ['id' => $row['id']]);
- if (!empty($row['iaid']) && !DBA::exists('item', ['iaid' => $row['iaid']])) {
- DBA::delete('item-activity', ['id' => $row['iaid']]);
- }
- if (!empty($row['icid']) && !DBA::exists('item', ['icid' => $row['icid']])) {
- DBA::delete('item-content', ['id' => $row['icid']]);
- }
}
DBA::close($r);
$postarray['source'] = json_encode($post);
// Don't import our own comments
- if (DBA::exists('item', ['extid' => $postarray['uri'], 'uid' => $uid])) {
+ if (Item::exists(['extid' => $postarray['uri'], 'uid' => $uid])) {
logger("Item with extid " . $postarray['uri'] . " found.", LOGGER_DEBUG);
return [];
}
break;
}
- if (DBA::exists('item', ['uri' => 'twitter::' . $post->id_str, 'uid' => $uid])) {
+ if (Item::exists(['uri' => 'twitter::' . $post->id_str, 'uid' => $uid])) {
break;
}