]> git.mxchange.org Git - friendica.git/blob - src/Worker/RemoveContact.php
40ac937f100ed4656a3ff251eecceea7aeb4bfbe
[friendica.git] / src / Worker / RemoveContact.php
1 <?php
2 /**
3  * @file src/Worker/RemoveContact.php
4  * @brief Removes orphaned data from deleted contacts
5  */
6 namespace Friendica\Worker;
7
8 use Friendica\Database\DBA;
9
10 require_once 'include/dba.php';
11
12 class RemoveContact {
13         public static function execute($id) {
14
15                 // Only delete if the contact doesn't exist (anymore)
16                 $r = DBA::exists('contact', ['id' => $id]);
17                 if ($r) {
18                         return;
19                 }
20
21                 // Now we delete all the depending table entries
22                 DBA::delete('contact', ['id' => $id]);
23         }
24 }