3 * @file src/Worker/RemoveContact.php
4 * @brief Removes orphaned data from deleted contacts
6 namespace Friendica\Worker;
8 use Friendica\Database\DBA;
9 use Friendica\Core\Protocol;
11 require_once 'include/dba.php';
14 public static function execute($id) {
16 // Only delete if the contact is to be deleted
17 $condition = ['network' => Protocol::PHANTOM, 'id' => $id];
18 $r = DBA::exists('contact', $condition);
19 if (!DBA::isResult($r)) {
23 // Now we delete the contact and all depending tables
24 DBA::delete('contact', ['id' => $id]);