| 1 | 9 | ▶ | use 5.20.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package DBIx::Class::Smooth::Lookup::DateTime::datepart; | ||||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: Short intro | ||||||||||
| 8 | 9 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |||||||||
| 9 | 9 | our $VERSION = '0.0108'; | |||||||||
| 10 | |||||||||||
| 11 | 9 | ▶ | use parent 'DBIx::Class::Smooth::Lookup::Util'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 9 | ▶ | use Carp qw/carp confess/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 9 | ▶ | use experimental qw/signatures postderef/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | sub smooth__lookup__datepart($self, $column_name, $value, $params, @rest) { | ||||||||
|
Subroutine
smooth__lookup__datepart: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 16 | 0 | my $datepart = $params->[0]; | |||||||||
| 17 | 0 | $self->smooth__lookup_util__ensure_param_count($datepart, $params, { at_least => 1, at_most => 1, regex => qr/^[a-z_]+$/i }); | |||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | local $SIG{'__WARN__'} = sub ($message) { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 21 | 0 | ▶ | if($message =~ m{uninitialized value within %part_map}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | confess "<datepart> was passed <$datepart> as the datepart, but your database don't support that"; | |||||||||
| 23 | } | ||||||||||
| 24 | else { | ||||||||||
| 25 | 0 | warn $message; | |||||||||
| 26 | } | ||||||||||
| 27 | 0 | }; | |||||||||
| 28 | |||||||||||
| 29 | 0 | my $complete = $self->dt_SQL_pluck({ -ident => $column_name }, $datepart); | |||||||||
| 30 | |||||||||||
| 31 | 0 | my $function_call_string = $complete->$*->[0]; | |||||||||
| 32 | |||||||||||
| 33 | 0 | return { left_hand_function => { complete => $function_call_string }, value => $value }; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 9 | 1; | |||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||