File: | C4/Labels/Batch.pm |
Coverage: | 51.2% |
line | stmt | bran | cond | sub | time | code |
---|---|---|---|---|---|---|
1 | package C4::Labels::Batch; | |||||
2 | ||||||
3 | 2 2 2 | 15 7 58 | use strict; | |||
4 | 2 2 2 | 14 7 211 | use warnings; | |||
5 | ||||||
6 | 2 2 2 | 16 7 138 | use base qw(C4::Creators::Batch); | |||
7 | ||||||
8 | 2 2 2 | 48 39 51 | use autouse 'Data::Dumper' => qw(Dumper); | |||
9 | ||||||
10 | BEGIN { | |||||
11 | 2 2 2 2 | 219 35 45 157 | use version; our $VERSION = qv('1.0.0_1'); | |||
12 | } | |||||
13 | ||||||
14 | __PACKAGE__ =~ m/^C4::(.+)::.+$/; | |||||
15 | my $me = $1; | |||||
16 | ||||||
17 | sub new { | |||||
18 | 0 | my $self = shift; | ||||
19 | 0 | push @_, "creator", $me; | ||||
20 | 0 | return $self->SUPER::new(@_); | ||||
21 | } | |||||
22 | ||||||
23 | sub save { | |||||
24 | 0 | my $self = shift; | ||||
25 | 0 | push @_, "creator", $me; | ||||
26 | 0 | return $self->SUPER::save(@_); | ||||
27 | } | |||||
28 | ||||||
29 | sub retrieve { | |||||
30 | 0 | my $self = shift; | ||||
31 | 0 | push @_, "creator", $me; | ||||
32 | 0 | return $self->SUPER::retrieve(@_); | ||||
33 | } | |||||
34 | ||||||
35 | sub delete { | |||||
36 | 0 | if (ref($_[0])) { | ||||
37 | 0 | my $self = shift; # check to see if this is a method call | ||||
38 | 0 | push @_, "creator", $me; | ||||
39 | 0 | return $self->SUPER::delete(@_); | ||||
40 | } | |||||
41 | else { | |||||
42 | 0 | push @_, "creator", $me; | ||||
43 | 0 | return __PACKAGE__->SUPER::delete(@_); # XXX: is this too hackish? | ||||
44 | } | |||||
45 | } | |||||
46 | ||||||
47 | 1; |