mirror of
https://github.com/friendica/friendica
synced 2024-11-10 16:22:53 +00:00
Add block/unblock methods to Contact class
This commit is contained in:
parent
16d0c30328
commit
5fd4086fdc
1 changed files with 26 additions and 0 deletions
|
@ -821,4 +821,30 @@ class Contact extends BaseObject
|
|||
|
||||
return $account_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Blocks a contact
|
||||
*
|
||||
* @param int $uid
|
||||
* @return bool
|
||||
*/
|
||||
public static function block($uid)
|
||||
{
|
||||
$return = dba::update('contact', ['blocked' => true], ['id' => $uid]);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unblocks a contact
|
||||
*
|
||||
* @param int $uid
|
||||
* @return bool
|
||||
*/
|
||||
public static function unblock($uid)
|
||||
{
|
||||
$return = dba::update('contact', ['blocked' => false], ['id' => $uid]);
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue