use Friendica\Database\DBA;
use Friendica\Core\Protocol;
+use Friendica\Model\Item;
require_once 'include/dba.php';
}
// Now we delete the contact and all depending tables
+ $condition = ['contact-id' => $id];
+ do {
+ $items = Item::select(['id'], $condition, ['limit' => 100]);
+ while ($item = Item::fetch($items)) {
+ DBA::delete('item', ['id' => $item['id']]);
+ }
+ DBA::close($items);
+ } while (Item::exists($condition));
+
DBA::delete('contact', ['id' => $id]);
}
}
}
// Now we delete all user items
- Item::delete(['uid' => $uid], PRIORITY_LOW);
+ $condition = ['uid' => $uid, 'deleted' => false];
+ do {
+ $items = Item::select(['id'], $condition, ['limit' => 100]);
+ while ($item = Item::fetch($items)) {
+ Item::deleteById($item['id'], PRIORITY_LOW);
+ }
+ DBA::close($items);
+ } while (Item::exists($condition));
}
}