From 9733aff0f3f11498a3816306b89e7f404ff360ef Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Wed, 7 Dec 2016 17:07:43 -0800 Subject: [PATCH] A few changes that I had yet to commit. --- Supporters/lib/Supporters.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Supporters/lib/Supporters.pm b/Supporters/lib/Supporters.pm index afc2182..da82c74 100644 --- a/Supporters/lib/Supporters.pm +++ b/Supporters/lib/Supporters.pm @@ -1497,6 +1497,29 @@ sub donorTotalGaveInPeriod($$) { } return $amount; } + +###################################################################### + +=begin getType + +FIXME DOCS + +=cut + +sub getType ($$) { + my($self, $donorId) = @_; + + confess "donorFirstGave: donorId, \"$donorId\" not found in supporter database" + unless $self->_verifyId($donorId); + + return undef unless $self->isSupporter($donorId); + $self->_readLedgerData() if not defined $self->{ledgerData}; + + my $entityId = $self->getLedgerEntityId($donorId); + + return undef unless defined $self->{ledgerData}{$entityId}; + return $self->{ledgerData}{$entityId}{__TYPE__}; +} ###################################################################### =begin supporterExpirationDate