File Coverage

blib/lib/UR/Object/Command/UpdateIsMany.pm
Criterion Covered Total %
statement 17 19 89.4
branch n/a
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 20 26 76.9


line stmt bran cond sub pod time code
1             package UR::Object::Command::UpdateIsMany;
2              
3 11     11   3960 use strict;
  11         28  
  11         435  
4 11     11   71 use warnings 'FATAL';
  11         29  
  11         3020  
5              
6             class UR::Object::Command::UpdateIsMany {
7             is => 'Command::V2',
8             is_abstract => 1,
9             has_constant_transient => {
10             target_name_ub_pl => { via => 'namespace', to => 'target_name_ub_pl', },
11             },
12             doc => 'CRUD update is many property command class.',
13             };
14              
15 0     0 0 0 sub help_brief { $_[0]->__meta__->doc }
16 0     0 0 0 sub help_detail { $_[0]->__meta__->doc }
17              
18             sub execute {
19 2     2   268222 my $self = shift;
20              
21 2         17 my $target_name_ub_pl = $self->target_name_ub_pl;
22 2         136 my $property_function = $self->property_function;
23 2         21 my @new_values = $self->values;
24 2         5841 OBJECT: for my $object ( $self->$target_name_ub_pl ) {
25 2         4954 my $object_id = UR::Object::Command::CrudUtil->display_id_for_value($object);
26 2         17 for my $new_value ( $self->values ) {
27 2         5367 my $new_value_id = UR::Object::Command::CrudUtil->display_id_for_value($new_value);
28 2         37 $self->status_message("%s\t%s\t%s", uc($property_function), $object_id, $new_value_id);
29 2         1295 $object->$property_function($new_value);
30             }
31             }
32              
33 2         20983 1;
34             }
35              
36             1;