| 1 | package EntityModel::Query::UpdateField; | ||||||||||||||
| 2 | { | ||||||||||||||
| 3 | 34 | $EntityModel::Query::UpdateField::VERSION = '0.102'; | |||||||||||||
| 4 | } | ||||||||||||||
| 5 | 34 | ▶ | use EntityModel::Class { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 34 | '_isa' => [qw(EntityModel::Query::Field)], | |||||||||||||
| 7 | 'value' => 'string', | ||||||||||||||
| 8 | 34 | }; | |||||||||||||
| 9 | 34 | ▶ | no if $] >= 5.017011, warnings => "experimental::smartmatch"; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | |||||||||||||||
| 11 | =head1 NAME | ||||||||||||||
| 12 | |||||||||||||||
| 13 | EntityModel::Query::UpdateField - field to be updated in an update statement | ||||||||||||||
| 14 | |||||||||||||||
| 15 | =head1 VERSION | ||||||||||||||
| 16 | |||||||||||||||
| 17 | version 0.102 | ||||||||||||||
| 18 | |||||||||||||||
| 19 | =head1 SYNOPSIS | ||||||||||||||
| 20 | |||||||||||||||
| 21 | See L<Entitymodel::Query>. | ||||||||||||||
| 22 | |||||||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||||||
| 24 | |||||||||||||||
| 25 | See L<Entitymodel::Query>. | ||||||||||||||
| 26 | |||||||||||||||
| 27 | =cut | ||||||||||||||
| 28 | |||||||||||||||
| 29 | =head1 METHODS | ||||||||||||||
| 30 | |||||||||||||||
| 31 | =cut | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 2 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||
| 34 | 2 | my $class = shift; | |||||||||||||
| 35 | 2 | my $self = bless { }, $class; | |||||||||||||
| 36 | 2 | my $args = shift; | |||||||||||||
| 37 | 2 | my @spec; | |||||||||||||
| 38 | 2 | ▶ | if(ref $args ~~ 'HASH') { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 39 | 2 | push @spec, %$args; | |||||||||||||
| 40 | } elsif(ref $args ~~ 'ARRAY') { | ||||||||||||||
| 41 | 0 | push @spec, @$args; | |||||||||||||
| 42 | } else { | ||||||||||||||
| 43 | 0 | die "no idea what $args is"; | |||||||||||||
| 44 | } | ||||||||||||||
| 45 | |||||||||||||||
| 46 | 2 | ▶ | while(@spec) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 47 | 4 | my $k = shift(@spec); | |||||||||||||
| 48 | 4 | my $v = shift(@spec); | |||||||||||||
| 49 | 4 | $self->$k($v); | |||||||||||||
| 50 | } | ||||||||||||||
| 51 | 2 | return $self; | |||||||||||||
| 52 | } | ||||||||||||||
| 53 | |||||||||||||||
| 54 | 34 | 1; | |||||||||||||
| 55 | |||||||||||||||
| 56 | __END__ | ||||||||||||||