mirror of
https://github.com/friendica/friendica
synced 2024-11-11 15:02:55 +00:00
26 lines
588 B
PHP
26 lines
588 B
PHP
<?php
|
|
/**
|
|
* @file src/Worker/RemoveContact.php
|
|
* @brief Removes orphaned data from deleted contacts
|
|
*/
|
|
namespace Friendica\Worker;
|
|
|
|
use Friendica\Database\DBA;
|
|
use Friendica\Core\Protocol;
|
|
|
|
require_once 'include/dba.php';
|
|
|
|
class RemoveContact {
|
|
public static function execute($id) {
|
|
|
|
// Only delete if the contact is to be deleted
|
|
$condition = ['network' => Protocol::PHANTOM, 'id' => $id];
|
|
$r = DBA::exists('contact', $condition);
|
|
if (!DBA::isResult($r)) {
|
|
return;
|
|
}
|
|
|
|
// Now we delete the contact and all depending tables
|
|
DBA::delete('contact', ['id' => $id]);
|
|
}
|
|
}
|