package Support::SaleFileExplorer::FileList;

use strict;

use lib '/app/tools/common/lib';
use lib '/app/tools/raptor/lib';
use lib '/app/tools/support/lib';
use Common::XMLObject;
use base 'Common::XMLObject';

use Raptor::DB::Item::File;
use Support::SaleFileExplorer::File;

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

    my $periodID = $args{periodID};

    my $allFiles = Raptor::DB::Item::File->GetByPeriodID($periodID);
    while ( my $dbItem = $allFiles->next() ) {
        push @{ $self->{File} }, Support::SaleFileExplorer::File->new( dbItem => $dbItem );
    }

    return $self;
}

1;
