#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Statement::Artist::StatementTransactionList;

use strict;
use warnings;
use Carp;

use Data::Dumper;

use lib '/app/tools/common/lib';
use Common::Assert;

use lib '/app/tools/rps/lib';

use RPS::Statement::Artist::StatementTransaction;
use RPS::DB::Item::ArtistRoyaltyTransaction;

use Common::FormObject;
use base 'Common::FormObject';

sub _init
{
    my ($self, %args) = @_;

    $self->SUPER::_init(%args);

	my $statementID = $args{artistRoyaltyStatementID};

    $self->{ArtistStatementTransaction} = [];
	if ($statementID)
	{
        my $collection = RPS::DB::Item::ArtistRoyaltyTransaction->GetByArtistRoyaltyStatementID($statementID);

		while ($collection->hasNext())
		{
			my $obj = $collection->next();

            my $trans = RPS::Statement::Artist::StatementTransaction->new
            (
                _dbItem => $obj,
            );

            push @{$self->{ArtistStatementTransaction}}, $trans;
		}
	}

    return $self;
}


sub getList
{
    my ($self) = @_;

    return $self->{ArtistStatementTransaction};
}



1;
