#---------------------------------------------------------------
# ____                   _ _         ____  _                    
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___ 
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/                            
#
# Copyright (C) 2012 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#---------------------------------------------------------------
package RPS::Publisher::US::LicenseList;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::Assert;
use lib '/app/tools/bookpub/lib';
use BookPub::DB::Item::Imprint;
use BookPub::Catalog::Imprint;
use RPS::DB::Item::PublisherTrackLicense;
use RPS::Publisher::US::License;


use base 'Common::FormObject::List::NumericPaged';

sub _itemName { return 'License'; }


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

    my $publisherID = $args{publisherID};
    my $payorID = $args{payorID};
    my $directOrIndirect = $args{directOrIndirect};


    # I really want to speed this up, which essentially means a custom DB::Item.
    #
    return RPS::DB::Item::PublisherTrackLicense->GetListSorted($publisherID, $payorID, $directOrIndirect);
}

sub _getObj
{
    my ($self, $dbItem) = @_;
    assert($dbItem);

    return RPS::Publisher::US::License->new(dbItem => $dbItem);
}



1;
