line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UR::Object::Command::Delete; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
3703
|
use strict; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
417
|
|
4
|
11
|
|
|
11
|
|
68
|
use warnings 'FATAL'; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
2675
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
class UR::Object::Command::Delete { |
7
|
|
|
|
|
|
|
is => 'Command::V2', |
8
|
|
|
|
|
|
|
is_abstract => 1, |
9
|
|
|
|
|
|
|
has_constant => { |
10
|
|
|
|
|
|
|
target_name_ub => { via => 'namespace', to => 'target_name_ub', }, |
11
|
|
|
|
|
|
|
}, |
12
|
|
|
|
|
|
|
doc => 'CRUD delete 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
|
1
|
|
|
1
|
|
6945
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
10
|
my $tx = UR::Context::Transaction->begin; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
17860
|
my $target_name_ub = $self->target_name_ub; |
24
|
1
|
|
|
|
|
44
|
my $obj = $self->$target_name_ub; |
25
|
1
|
|
|
|
|
10
|
my $msg = sprintf('DELETE %s %s', $obj->class, $obj->id); |
26
|
1
|
|
|
|
|
14
|
$obj->delete; |
27
|
|
|
|
|
|
|
|
28
|
1
|
50
|
|
|
|
635
|
if (!$tx->commit ) { |
29
|
0
|
|
|
|
|
0
|
$tx->rollback; |
30
|
0
|
|
|
|
|
0
|
$self->fatal_message('Failed to commit software transaction!'); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
4631
|
$self->status_message($msg); |
34
|
1
|
|
|
|
|
571
|
1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |