X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveUser.php;h=0db881a0a99e8e19c961c868ebfeb139bd0d8db5;hb=b407fbedc1ccf9b7fe5226898ee232482c0fe438;hp=fb57b1d7c402ff4290c9a15f8aebd3b33d48748f;hpb=0a4119adaf6294bf43d135a0f435c1dd677c50e0;p=friendica.git diff --git a/src/Worker/RemoveUser.php b/src/Worker/RemoveUser.php index fb57b1d7c4..0db881a0a9 100644 --- a/src/Worker/RemoveUser.php +++ b/src/Worker/RemoveUser.php @@ -1,13 +1,33 @@ . + * */ + namespace Friendica\Worker; use Friendica\Database\DBA; use Friendica\Model\Item; +use Friendica\Model\Post; +/** + * Removes orphaned data from deleted users + */ class RemoveUser { public static function execute($uid) { @@ -20,11 +40,11 @@ class RemoveUser { // 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)); } }