From 95518f92108f8465f669d30c07e9c4f07be7a323 Mon Sep 17 00:00:00 2001 From: djfiander Date: Tue, 21 Mar 2006 00:17:54 +0000 Subject: [PATCH] Beginnings of the Item stub module: support for the Checkout operation --- ILS/Item.pm | 40 +++++++++++++++++++++++++++++++++++++++- ILS/Patron.pm | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ILS/Item.pm b/ILS/Item.pm index 8f6a4b5..a772856 100644 --- a/ILS/Item.pm +++ b/ILS/Item.pm @@ -11,25 +11,63 @@ use strict; use warnings; use Exporter; +use Sys::Syslog qw(syslog); + our (@ISA, @EXPORT_OK); @ISA = qw(Exporter); -our %item_db; +our %item_db = ( + 1565921879 => { + title => "Perl 5 desktop reference", + id => 1565921879, + sip_media_type => '001', + magnetic_media => 0, + } + ); sub new { my ($class, $item_id) = @_; my $type = ref($class) || $class; my $self; + if (!exists($item_db{$item_id})) { + syslog("DEBUG", "new ILS::Item('%s'): not found", $item_id); return undef; } $self = $item_db{$item_id}; bless $self, $type; + + syslog("DEBUG", "new ILS::Item('%s'): found with title '%s'", + $item_id, $self->{title}); + return $self; } +sub magnetic { + my $self = shift; + + return $self->{magnetic_media}; +} + +sub sip_media_type { + my $self = shift; + + return $self->{sip_media_type}; +} + +sub sip_item_properties { + my $self = shift; + + return $self->{sip_item_properties}; +} + +sub title_id { + my $self = shift; + + return $self->{title}; +} 1; diff --git a/ILS/Patron.pm b/ILS/Patron.pm index 2b49774..4ad6d41 100644 --- a/ILS/Patron.pm +++ b/ILS/Patron.pm @@ -35,6 +35,7 @@ our %patron_db = ( fees => 0, recall_overdue => 0, items_billed => 0, + items => [], }, ); -- 2.11.0