webgui/lib/WebGUI/Commerce/Item/Event.pm
Colin Kuskie 34b2068286 POD docs
2006-03-05 06:42:07 +00:00

85 lines
1.9 KiB
Perl

package WebGUI::Commerce::Item::Event;
=head1 NAME
Package WebGUI::Commerce::Item::Event
=head1 DESCRIPTION
Item plugin for events in the EventManagement system. Allows events entered there
to be part of the Commerce system.
=cut
use strict;
our @ISA = qw(WebGUI::Commerce::Item);
#-------------------------------------------------------------------
sub available {
return $_[0]->{_event}->{approved};
}
#-------------------------------------------------------------------
sub description {
return $_[0]->{_event}->{description};
}
#-------------------------------------------------------------------
sub id {
return $_[0]->{_event}->{productId};
}
#-------------------------------------------------------------------
sub isRecurring {
return 0;
}
#-------------------------------------------------------------------
sub name {
return $_[0]->{_event}->{title};
}
#-------------------------------------------------------------------
=head2 new ( $session )
Overload default constructor to glue in information from the EMS.
=cut
sub new {
my ($class, $session, $eventId, $eventData);
$class = shift;
$session = shift;
$eventId = shift;
my $eventData = $session->db->quickHashRef("select p.productId, p.title, p.description, p.price, e.approved
from EventManagementSystem_products as e, products as p
where p.productId = e.productId and p.productId=".$session->db->quote($eventId));
bless {_event => $eventData}, $class;
}
#-------------------------------------------------------------------
sub needsShipping {
return 0;
}
#-------------------------------------------------------------------
sub price {
return $_[0]->{_event}->{price};
}
#-------------------------------------------------------------------
sub type {
return 'Event';
}
#-------------------------------------------------------------------
sub weight {
return 0;
}
1;