DBIx/Class/CDBICompat/Constructor.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« DBIx/Class/CDBICompat/AutoUpdate.pm ↑ Summary DBIx/Class/CDBICompat/LiveObjectIndex.pm »
1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::Constructor;
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use base 'DBIx::Class::CDBICompat::ImaDBI';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 use Carp;
10 use DBIx::Class::_Util qw(quote_sub perlstring);
11  
12 __PACKAGE__->set_sql(Retrieve => <<'');
13 SELECT __ESSENTIAL__
14 FROM __TABLE__
15 WHERE %s
16  
17 sub add_constructor {
18 my ($class, $method, $fragment) = @_;
19  
20 croak("constructors needs a name") unless $method;
21  
22 carp("$method already exists in $class") && return
23 if $class->can($method);
24  
25 quote_sub "${class}::${method}" => sprintf( <<'EOC', perlstring $fragment );
26 my $self = shift;
27 $self->sth_to_objects($self->sql_Retrieve(%s), \@_);
28 EOC
29 }
30  
31 1;
« DBIx/Class/CDBICompat/AutoUpdate.pm ↑ Summary DBIx/Class/CDBICompat/LiveObjectIndex.pm »