friendica-github/src/Worker/RemoveContact.php

25 lines
486 B
PHP
Raw Normal View History

2017-11-17 22:16:34 +00:00
<?php
/**
* @file src/Worker/RemoveContact.php
* @brief Removes orphaned data from deleted contacts
*/
namespace Friendica\Worker;
use Friendica\Database\dba;
2017-11-17 22:16:34 +00:00
require_once 'include/dba.php';
2017-11-17 22:16:34 +00:00
class RemoveContact {
public static function execute($id) {
// Only delete if the contact doesn't exist (anymore)
$r = dba::exists('contact', ['id' => $id]);
2017-11-17 22:16:34 +00:00
if ($r) {
return;
}
// Now we delete all the depending table entries
dba::delete('contact', ['id' => $id]);
2017-11-17 22:16:34 +00:00
}
}