Remove a dislike from this record for the given user.

@param int|null $userId If null will use currently logged in user.
@return void

@throws \Cog\Likeable\Exceptions\LikerNotDefinedException
336342
public function undislike($userId = null)
    {
        app(LikeableServiceContract::class)->removeLikeFrom($this, LikeType::DISLIKE, $userId);
    }
288289
public void remove(DbSession dbSession, ComponentDto component, @Nullable Integer userId) {
    if (userId == null) {
      return;
    }

    int result = dbClient.propertiesDao().delete(dbSession, new PropertyDto()
      .setKey(PROP_FAVORITE_KEY)
      .setResourceId(component.getId())
      .setUserId(userId));
    checkArgument(result == 1, "Component '%s' is not a favorite", component.getDbKey());
  }
1190691
public function __async_delete($userID)
    {
        $user = null;

        if (dbQuery('user')->UserID($userID)->first($user)) {
            $user->delete();
        }

        return array(
            'status'=>1
        );
    }
1105285
protected static function delete_stats(int $courseid, int $userid = null) {
        global $DB;
        $params = (isset($userid)) ? ['courseid' => $courseid, 'userid' => $userid] : ['courseid' => $courseid];
        $DB->delete_records('stats_user_daily', $params);
        $DB->delete_records('stats_user_weekly', $params);
        $DB->delete_records('stats_user_monthly', $params);
    }
55849
public function dislikeToggle($userId = null)
    {
        app(LikeableServiceContract::class)->toggleLikeOf($this, LikeType::DISLIKE, $userId);
    }
751469
public static function delete_stale_subscriptions($userid = 0) {
        global $DB;
        // Get the expiry duration, in days.
        $cutofftime = strtotime("-" . self::INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS . " days", time());

        if (!empty($userid)) {
            // Remove any stale subscriptions for the desired user only.
            $success = $DB->delete_records_select('tool_monitor_subscriptions',
                                                  'userid = ? AND inactivedate < ? AND inactivedate <> 0',
                                                  array($userid, $cutofftime));

        } else {
            // Remove all stale subscriptions.
            $success = $DB->delete_records_select('tool_monitor_subscriptions',
                                                  'inactivedate < ? AND inactivedate <> 0',
                                                  array($cutofftime));
        }
        return $success;
    }
1343810
public function removeByUserId($userId): void
    {
        $results = $this->findBy(['userId' => $userId]);

        foreach ($results as $result) {
            $this->getEntityManager()->remove($result);
        }

        $this->getEntityManager()->flush();
    }
231882
@Override
    public void removeUser(int userID) {
        super.removeUser(userID);
        ratingsUser.remove(userID);
        usersStats.remove(userID);
    }
1014980
public function deleteUserLoginTokenFields($userID) {
        $user = $this->getFind($userID);

        $user->login_token            = '';
        $user->login_token_created_at = '';

        return $user->save();
    }
265513
public static function export_user_preferences(int $userid) {

        $uservisibility = get_user_preferences('block_online_users_uservisibility', 1, $userid);

        writer::export_user_preference('block_online_users',
                'block_online_users_uservisibility', transform::yesno($uservisibility),
                get_string('privacy:metadata:preference:uservisibility', 'block_online_users'));
    }
798600
public function DeleteUserData($UserID, $Options = array(), &$Data = NULL) {
      $SQL = Gdn::SQL();
      
      // Remove discussion watch records and drafts.
		$SQL->Delete('UserDiscussion', array('UserID' => $UserID));
      
		Gdn::UserModel()->GetDelete('Draft', array('InsertUserID' => $UserID), $Data);
      
      // Comment deletion depends on method selected
      $DeleteMethod = GetValue('DeleteMethod', $Options, 'delete');
      if ($DeleteMethod == 'delete') {
         // Clear out the last posts to the categories.
         $SQL
            ->Update('Category c')
            ->Join('Discussion d', 'd.DiscussionID = c.LastDiscussionID')
            ->Where('d.InsertUserID', $UserID)
            ->Set('c.LastDiscussionID', NULL)
            ->Set('c.LastCommentID', NULL)
            ->Put();
         
         $SQL
            ->Update('Category c')
            ->Join('Comment d', 'd.CommentID = c.LastCommentID')
            ->Where('d.InsertUserID', $UserID)
            ->Set('c.LastDiscussionID', NULL)
            ->Set('c.LastCommentID', NULL)
            ->Put();
         
         // Grab all of the discussions that the user has engaged in.
         $DiscussionIDs = $SQL
            ->Select('DiscussionID')
            ->From('Comment')
            ->Where('InsertUserID', $UserID)
            ->GroupBy('DiscussionID')
            ->Get()->ResultArray();
         $DiscussionIDs = ConsolidateArrayValuesByKey($DiscussionIDs, 'DiscussionID');

         
         Gdn::UserModel()->GetDelete('Comment', array('InsertUserID' => $UserID), $Data);
         
         // Update the comment counts.
         $CommentCounts = $SQL
            ->Select('DiscussionID')
            ->Select('CommentID', 'count', 'CountComments')
            ->Select('CommentID', 'max', 'LastCommentID')
            ->WhereIn('DiscussionID', $DiscussionIDs)
            ->GroupBy('DiscussionID')
            ->Get('Comment')->ResultArray();
         
         foreach ($CommentCounts as $Row) {
            $SQL->Put('Discussion',
               array('CountComments' => $Row['CountComments'] + 1, 'LastCommentID' => $Row['LastCommentID']),
               array('DiscussionID' => $Row['DiscussionID']));
         }
         
         // Update the last user IDs.
         $SQL->Update('Discussion d')
            ->Join('Comment c', 'd.LastCommentID = c.CommentID', 'left')
            ->Set('d.LastCommentUserID', 'c.InsertUserID', FALSE, FALSE)
            ->Set('d.DateLastComment', 'c.DateInserted', FALSE, FALSE)
            ->WhereIn('d.DiscussionID', $DiscussionIDs)
            ->Put();
         
         // Update the last posts.
         $Discussions = $SQL
            ->WhereIn('DiscussionID', $DiscussionIDs)
            ->Where('LastCommentUserID', $UserID)
            ->Get('Discussion');
         
         // Delete the user's dicussions 
         Gdn::UserModel()->GetDelete('Discussion', array('InsertUserID' => $UserID), $Data);
         
         // Update the appropriat recent posts in the categories.
         $CategoryModel = new CategoryModel();
         $Categories = $CategoryModel->GetWhere(array('LastDiscussionID' => NULL))->ResultArray();
         foreach ($Categories as $Category) {
            $CategoryModel->SetRecentPost($Category['CategoryID']);
         }
      } else if ($DeleteMethod == 'wipe') {
         // Erase the user's dicussions
         $SQL->Update('Discussion')
            ->Set('Body', T('The user and all related content has been deleted.'))
            ->Set('Format', 'Deleted')
            ->Where('InsertUserID', $UserID)
            ->Put();

         $SQL->Update('Comment')
            ->Set('Body', T('The user and all related content has been deleted.'))
            ->Set('Format', 'Deleted')
            ->Where('InsertUserID', $UserID)
            ->Put();
      } else {
         // Leave comments
      }

      // Remove the user's profile information related to this application
      $SQL->Update('User')
         ->Set(array(
				'CountDiscussions' => 0,
				'CountUnreadDiscussions' => 0,
				'CountComments' => 0,
				'CountDrafts' => 0,
				'CountBookmarks' => 0
			))
         ->Where('UserID', $UserID)
         ->Put();
   }
728375
public function deleteUser(int $user_id, array $args = [])
    {
        $this->getDriver()->user->delete($user_id, $args);
    }
1132043
public function likeToggle($userId = null)
    {
        app(LikeableServiceContract::class)->toggleLikeOf($this, LikeType::LIKE, $userId);
    }
853818
public function isUserInForcedVariation($userId)
    {
        $forcedVariations = $this->getForcedVariations();
        return !is_null($forcedVariations) && isset($forcedVariations[$userId]);
    }
888845
final function throttle(string $userID) {
        if(empty($this->throttling) || $this->client->isOwner($userID)) {
            return null;
        }
        
        if(!$this->throttles->has($userID)) {
            $this->throttles->set($userID, array(
                'start' => \time(),
                'usages' => 0,
                'timeout' => $this->client->addTimer($this->throttling['duration'], function () use ($userID) {
                    $this->throttles->delete($userID);
                })
            ));
        }
        
        return $this->throttles->get($userID);
    }
484667
public function deleteUserQuery($userId)
    {
        $qb = $this->createQueryBuilder();
        $qb->delete($this->getTableName());

        if (is_numeric($userId)) {
            $qb->where('id = :userId');
        } else {
            $qb->where('username = :userId')->orWhere('email = :userId');
        }
        $qb->setParameter('userId', $userId);

        return $qb;
    }
1197864
public function dislike($userId = null)
    {
        app(LikeableServiceContract::class)->addLikeTo($this, LikeType::DISLIKE, $userId);
    }