<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Database\DBA;
use Friendica\Model\Item;
+use Friendica\Model\Post;
/**
* Removes orphaned data from deleted users
// Now we delete all user items
$condition = ['uid' => $uid, 'deleted' => false];
do {
- $items = Item::select(['id'], $condition, ['limit' => 100]);
- while ($item = Item::fetch($items)) {
- Item::deleteById($item['id'], PRIORITY_NEGLIGIBLE);
+ $items = Post::select(['id'], $condition, ['limit' => 100]);
+ while ($item = Post::fetch($items)) {
+ Item::markForDeletionById($item['id'], PRIORITY_NEGLIGIBLE);
}
DBA::close($items);
- } while (Item::exists($condition));
+ } while (Post::exists($condition));
}
}