| File: | C4/Patroncards/Template.pm |
| Coverage: | 61.9% |
| line | stmt | bran | cond | sub | time | code |
|---|---|---|---|---|---|---|
| 1 | package C4::Patroncards::Template; | |||||
| 2 | ||||||
| 3 | 4 4 4 | 16538 46 121 | use strict; | |||
| 4 | 4 4 4 | 47 34 205 | use warnings; | |||
| 5 | ||||||
| 6 | 4 4 4 | 62 45 432 | use base qw(C4::Creators::Template); | |||
| 7 | ||||||
| 8 | 4 4 4 | 186 29 97 | use autouse 'Data::Dumper' => qw(Dumper); | |||
| 9 | ||||||
| 10 | BEGIN { | |||||
| 11 | 4 4 4 4 | 388 27 70 302 | use version; our $VERSION = qv('1.0.0_1'); | |||
| 12 | } | |||||
| 13 | ||||||
| 14 | 4 4 4 | 187 21 55 | use constant TEMPLATE_TABLE => 'creator_templates'; | |||
| 15 | ||||||
| 16 | __PACKAGE__ =~ m/^C4::(.+)::.+$/; | |||||
| 17 | my $me = $1; | |||||
| 18 | ||||||
| 19 | sub new { | |||||
| 20 | 0 | my $self = shift; | ||||
| 21 | 0 | push @_, "creator", $me; | ||||
| 22 | 0 | return $self->SUPER::new(@_); | ||||
| 23 | } | |||||
| 24 | ||||||
| 25 | sub retrieve { | |||||
| 26 | 0 | my $self = shift; | ||||
| 27 | 0 | push @_, "table_name", TEMPLATE_TABLE, "creator", $me; | ||||
| 28 | 0 | return $self->SUPER::retrieve(@_); | ||||
| 29 | } | |||||
| 30 | ||||||
| 31 | sub delete { | |||||
| 32 | 0 | my $self = shift; | ||||
| 33 | 0 | push @_, "table_name", TEMPLATE_TABLE, "creator", $me; | ||||
| 34 | 0 | return $self->SUPER::delete(@_); | ||||
| 35 | } | |||||
| 36 | ||||||
| 37 | sub save { | |||||
| 38 | 0 | my $self = shift; | ||||
| 39 | 0 | push @_, "table_name", TEMPLATE_TABLE, "creator", $me; | ||||
| 40 | 0 | return $self->SUPER::save(@_); | ||||
| 41 | } | |||||
| 42 | ||||||
| 43 | 1; | |||||