#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package Common::MapFace::MapFaceFileList;

use strict;
use warnings;
use Data::Dumper;

use lib '/app/tools/common/lib';
use Common::Assert;
use Common::DB::Item::MapFaceFile;
use Common::MapFace::MapFaceFile;

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

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

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

    my $status = $args{status};
    my $limit  = $args{limit};
    my $order  = $args{order};

    $self->{MapFaceFile} = [];

    my $fileCollection = Common::DB::Item::MapFaceFile->GetAllByStatus( status => $status, limit => $limit, order => $order );

    while ( $fileCollection->hasNext() ) {
        my $fileObj = $fileCollection->next();
        push @{ $self->{MapFaceFile} }, Common::MapFace::MapFaceFile->new( _dbItem => $fileObj );
    }

    return $self;
}

sub _listProperties {
    return { MapFaceFile => 1 };
}

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

    return $self->{MapFaceFile};
}

1;
