public static function count_blocked_users($user = null) {
        global $USER, $DB;

        if (empty($user)) {
            $user = $USER;
        }

        $sql = "SELECT count(mub.id)
                  FROM {message_users_blocked} mub
                 WHERE mub.userid = :userid";
        return $DB->count_records_sql($sql, array('userid' => $user->id));
    }
public static function count_blocked_users($user = null) {
        global $USER, $DB;

        if (empty($user)) {
            $user = $USER;
        }

        $sql = "SELECT count(mub.id)
                  FROM {message_users_blocked} mub
                 WHERE mub.userid = :userid";
        return $DB->count_records_sql($sql, array('userid' => $user->id));
    }
public static function count_blocked_users ( $ user = null ) { global $ USER , $ DB ; if ( empty ( $ user ) ) { $ user = $ USER ; } $ sql = "SELECT count(mub.id)
                  FROM {message_users_blocked} mub
                 WHERE mub.userid = :userid" ; return $ DB -> count_records_sql ( $ sql , array ( 'userid' => $ user -> id ) ) ; }
Count the number of users blocked by a user.

@param \stdClass $user The user object
@return int the number of blocked users
Count the number of users blocked by a user .