#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#---------------------------------------------------------------
package BookPub::Catalog::BookSubjectList;

use strict;
use warnings;

use lib '/app/tools/bookpub/lib';
use BookPub::Catalog::BookSubject::WithLiteral;
use BookPub::DB::Item::BookSubject;

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

use Data::Dumper;

sub _itemName { 'Subject' }

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

    my $bookID = $args{bookID};
    return undef unless $bookID;

    return BookPub::DB::Item::BookSubject->GetAllByBookID($bookID);
}

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

    return BookPub::Catalog::BookSubject::WithLiteral->new( dbItem => $dbItem );
}
1;
