From 5fd4086fdcc7725dc2eddaf631b4819e84dfb61b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 1 Dec 2017 00:41:26 -0500 Subject: [PATCH] Add block/unblock methods to Contact class --- src/Object/Contact.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Object/Contact.php b/src/Object/Contact.php index 919113672..1aee2c2b5 100644 --- a/src/Object/Contact.php +++ b/src/Object/Contact.php @@ -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; + } }