#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2007 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#---------------------------------------------------------------
package RPS::Statement::Mechanical::StatementLicenseTransactionList;

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 Common::FormObject;
use base 'Common::FormObject';

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

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

    my $id = $args{mechanicalStatementLicenseID};

    $self->{MechanicalStatementLicenseTransaction} = [];
    if ($id) {
        my $collection = $self->_getStatementLicenseTransactionCollection($id);

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

            my $trans = $self->_getStatementLicenseTransaction($obj);

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

    return $self;
}

sub _getStatementLicenseTransactionCollection {
    my ( $self, $statementLicenseID ) = @_;
    assert( 0, 'override this' );
}

sub _getStatementLicenseTransaction {
    my ( $self, $dbItem ) = @_;
    assert( 0, 'override this' );
}

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

    return $self->{MechanicalStatementLicenseTransaction};
}

1;
