# Copyright (c) 2001 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: ItemList.pm,v 2.1 2006/10/16 21:08:04 moeller Exp $ package Bivio::PetShop::Model::ItemList; use strict; $Bivio::PetShop::Model::ItemList::VERSION = sprintf('%d.%02d', q$Revision: 2.1 $ =~ /\d+/g); $_ = $Bivio::PetShop::Model::ItemList::VERSION; =head1 NAME Bivio::PetShop::Model::ItemList - list of items by product =head1 RELEASE SCOPE bOP =head1 SYNOPSIS use Bivio::PetShop::Model::ItemList; =cut =head1 EXTENDS L =cut use Bivio::Biz::ListModel; @Bivio::PetShop::Model::ItemList::ISA = ('Bivio::Biz::ListModel'); =head1 DESCRIPTION C =cut #=IMPORTS #=VARIABLES =head1 METHODS =cut =for html =head2 internal_initialize() : hash_ref; B =cut sub internal_initialize { return { version => 1, primary_key => [ ['Item.item_id'], ], other => [ 'Product.name', { name => 'item_name', type => 'Line', constraint => 'NONE', }, [qw(Item.product_id Product.product_id)], ], order_by => [ 'Item.attr1', 'Product.name', 'Item.item_id', 'Item.list_price', ], parent_id => ['Item.product_id'], }; } =for html =head2 internal_post_load_row(hash_ref row) : boolean Sets the item_name using Item.attr1 and Product.name. =cut sub internal_post_load_row { my($self, $row) = @_; $row->{'item_name'} = Bivio::PetShop::Model::Item->format_name( $row->{'Item.attr1'}, $row->{'Product.name'}); return 1; } #=PRIVATE METHODS =head1 COPYRIGHT Copyright (c) 2001 bivio Software, Inc. All rights reserved. Visit http://www.bivio.biz for more info. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; If not, you may get a copy from: http://www.opensource.org/licenses/lgpl-license.html =head1 VERSION $Id: ItemList.pm,v 2.1 2006/10/16 21:08:04 moeller Exp $ =cut 1;