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

use strict;
use warnings;

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

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

use Data::Dumper;

sub _itemName { 'Subject' }

# The ONLY purpose of this list class is searching...
#
sub _init {
    my ( $self, %args ) = @_;

    $self->{_searchQuery} = $args{query};
    $self->{_searchLimit} = $args{limit};

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

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

    my $collection = BookPub::DB::Item::BISACSubject->Search( searchTerm => $self->{_searchQuery}, limit => $self->{_searchLimit} );
    return $collection;
}

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

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