X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveContact.php;h=28a32160a014c7c830f5f5d5fb71952701792030;hb=d4f7bfa676bc9a8ffcb304912b48b360453d0f3c;hp=2f005cd1470c76fc7826b73f5419c7a167313da3;hpb=7db4c7ea02cdf2c5a1a6e6314aebf206ca25319f;p=friendica.git diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 2f005cd147..28a32160a0 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -1,14 +1,34 @@ . + * */ + namespace Friendica\Worker; +use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\Core\Protocol; use Friendica\Model\Item; +/** + * Removes orphaned data from deleted contacts + */ class RemoveContact { public static function execute($id) { @@ -21,8 +41,9 @@ class RemoveContact { // Now we delete the contact and all depending tables $condition = ['uid' => $contact['uid'], 'contact-id' => $id]; do { - $items = Item::select(['id'], $condition, ['limit' => 100]); + $items = Item::select(['id', 'guid'], $condition, ['limit' => 100]); while ($item = Item::fetch($items)) { + Logger::info('Delete removed contact item', ['id' => $item['id'], 'guid' => $item['guid']]); DBA::delete('item', ['id' => $item['id']]); } DBA::close($items);