From 79cb5b1bae59ffde96b7749f84e45f235d9db99d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 15 May 2019 19:28:00 -0400 Subject: [PATCH] Add block reason editing in Model\Contact --- src/Model/Contact.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 00a303a8b9..ce3aeac560 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1670,13 +1670,13 @@ class Contact extends BaseObject /** * @brief Blocks a contact * - * @param int $uid + * @param int $cid * @return bool * @throws \Exception */ - public static function block($uid) + public static function block($cid, $reason = null) { - $return = DBA::update('contact', ['blocked' => true], ['id' => $uid]); + $return = DBA::update('contact', ['blocked' => true, 'block_reason' => $reason], ['id' => $cid]); return $return; } @@ -1684,13 +1684,13 @@ class Contact extends BaseObject /** * @brief Unblocks a contact * - * @param int $uid + * @param int $cid * @return bool * @throws \Exception */ - public static function unblock($uid) + public static function unblock($cid) { - $return = DBA::update('contact', ['blocked' => false], ['id' => $uid]); + $return = DBA::update('contact', ['blocked' => false, 'block_reason' => null], ['id' => $cid]); return $return; }