| 1 | # -*-perl-*- | ||||||||||||||||||||
| 2 | # Creation date: 2003-03-30 15:24:44 | ||||||||||||||||||||
| 3 | # Authors: Don | ||||||||||||||||||||
| 4 | # Change log: | ||||||||||||||||||||
| 5 | # $Revision: 1963 $ | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | # Copyright (c) 2003-2012 Don Owens | ||||||||||||||||||||
| 8 | # | ||||||||||||||||||||
| 9 | # All rights reserved. This program is free software; you can | ||||||||||||||||||||
| 10 | # redistribute it and/or modify it under the same terms as Perl | ||||||||||||||||||||
| 11 | # itself. | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | { package DBIx::Wrapper::StatementLoop; | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 2 | ▶ | use vars qw($VERSION); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 2 | $VERSION = do { my @r=(q$Revision: 1963 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 2 | ▶ | use base 'DBIx::Wrapper::Statement'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 23 | 0 | my ($proto, $parent, $query) = @_; | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 0 | my $r = DBIx::Wrapper::Request->new($parent); | |||||||||||||||||||
| 26 | 0 | $r->setQuery($query); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | $parent->_runPrePrepareHook($r); | |||||||||||||||||||
| 29 | 0 | $query = $r->getQuery; | |||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 0 | my $sth = $parent->_getDatabaseHandle()->prepare($query); | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | $r->setStatementHandle($sth); | |||||||||||||||||||
| 34 | 0 | $parent->_runPostPrepareHook($r); | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 0 | $r->setStatementHandle($sth); | |||||||||||||||||||
| 37 | 0 | ▶ | unless ($sth) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | 0 | $parent->_printDbiError("\nQuery was '$query'\n"); | |||||||||||||||||||
| 39 | 0 | return $parent->setErr(0, $DBI::errstr); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | my $self = bless {}, ref($proto) || $proto; | ||||||||||||||||||
|
Condition0%0/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 43 | 0 | $self->_setSth($sth); | |||||||||||||||||||
| 44 | 0 | $self->_setParent($parent); | |||||||||||||||||||
| 45 | 0 | $self->_setQuery($query); | |||||||||||||||||||
| 46 | 0 | $self->_setRequestObj($r); | |||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 0 | return $self; | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | sub next { | ||||||||||||||||||
|
Subroutine
next: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 52 | 0 | my ($self, $exec_args) = @_; | |||||||||||||||||||
| 53 | 0 | ▶ | if (scalar(@_) == 3) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 54 | 0 | ▶ | $exec_args = [ $exec_args ] unless ref($exec_args); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | 0 | ▶ | $exec_args = [] unless $exec_args; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 0 | my $r = $self->_getRequestObj; | |||||||||||||||||||
| 59 | 0 | $r->setExecArgs($exec_args); | |||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 0 | my $sth = $self->_getSth; | |||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 0 | $self->_getParent()->_runPreExecHook($r); | |||||||||||||||||||
| 64 | 0 | $exec_args = $r->getExecArgs; | |||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | my $rv = $sth->execute(@$exec_args); | |||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 0 | $r->setExecReturnValue($rv); | |||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 0 | $self->_getParent()->_runPostExecHook($r); | |||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 0 | return $rv; | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||
|
Subroutine
DESTROY: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 76 | 0 | my ($self) = @_; | |||||||||||||||||||
| 77 | 0 | my $sth = $self->_getSth; | |||||||||||||||||||
| 78 | 0 | ▶ | $sth->finish if $sth; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 79 | } | ||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 2 | 1; | |||||||||||||||||||
| 84 | |||||||||||||||||||||