public function markAllNotificationsAsSeen(AccountInterface $account) {

    // Retrieve all the activities referring this entity for this account.
    $ids = $this->getNotificationIds($account, [ACTIVITY_STATUS_RECEIVED]);

    foreach ($ids as $activity_id) {
      $activity = Activity::load($activity_id);
      $this->changeStatusOfActivity($activity, ACTIVITY_STATUS_SEEN);
    }

    $remaining_notifications = 0;
    return $remaining_notifications;
  }