LCC/Documents/DBI.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 21 SCAR 17.9
CC
2
Cov
0%
_new
6.0
next_document
2.0
BEGIN
2.0
CRAP 6.0
1 package LCC::Documents::DBI;
2  
3 # Make sure we do everything by the book
4 # Set modules to inherit from
5 # Set version information
6  
7 use strict;
8 @LCC::Documents::DBI::ISA = qw(LCC::Documents);
9 $LCC::Documents::DBI::VERSION = '0.01';
10  
11 # Return true value for use
12  
13 1;
14  
15 #------------------------------------------------------------------------
16  
17 # The following methods are class methods
18  
19 #------------------------------------------------------------------------
20  
21 # IN: 1 class of object
22 # 2 instantiated LCC object
23 # 3 DBI statement handle
24 # 4 method => value pairs to be executed
25 # OUT: 1 instantiated LCC::Documents::xxx object
26  
27 sub _new {
28  
29 # Obtain the class
30 # Obtain the LCC object
31 # Obtain the source (a ref to a database handle, table name list)
32  
33 my $class = shift;
34 my $lcc = shift;
35 my $source = shift;
36  
37 # Add error if the source is not a statement handle
38  
39 $lcc->_add_error( "$source is not a DBI statement handle" )
40 unless ref($source) eq 'DBI::st';
41  
42 # Create the object in the right way
43 # Save the source specification
44 # Return the object
45  
46 my $self = $class->SUPER::_new( $lcc,@_ );
47 $self->{'source'} = $source;
48 return $self;
49 } #_new
50  
51 #------------------------------------------------------------------------
52  
53 # The following methods change the object
54  
55 #------------------------------------------------------------------------
56  
57 # IN: 1 instantiated object
58 # OUT: 1 id of the next document
59 # 2 mtime of the next document
60 # 3 (optional) length of the next document
61 # 4 (optional) md5 of the next document
62 # 5 (optional) mimetype of the next document
63 # 6 (optional) subtype of the next document
64  
65 sub next_document { shift->{'source'}->fetchrow_array } #next_document
66  
67 #------------------------------------------------------------------------
68  
69 # The following subroutines deal with standard Perl features
70  
71 #------------------------------------------------------------------------
72  
73 __END__