line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Object::I18n::Storage::MemHash; |
3
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
421
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $memhash = {}; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
10
|
0
|
|
|
|
|
|
my ($obj, $method) = @_; |
11
|
0
|
|
|
|
|
|
bless { |
12
|
|
|
|
|
|
|
object => $obj, |
13
|
|
|
|
|
|
|
memstore => $memhash, |
14
|
|
|
|
|
|
|
method => $method, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub fetch { |
19
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
20
|
0
|
|
|
|
|
|
my $i18n = $self->{object}->i18n; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $class = $i18n->{class}; |
23
|
0
|
|
|
|
|
|
my $oid = $i18n->oid; |
24
|
0
|
|
|
|
|
|
my $method = $self->{method}; |
25
|
0
|
|
|
|
|
|
my $language= $i18n->language; |
26
|
0
|
|
|
|
|
|
return $memhash->{$class}{$oid}{$method}{$language}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub store { |
30
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
31
|
0
|
|
|
|
|
|
my ($data) = @_; |
32
|
0
|
|
|
|
|
|
my $i18n = $self->{object}->i18n; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $class = $i18n->{class}; |
35
|
0
|
|
|
|
|
|
my $oid = $i18n->oid; |
36
|
0
|
|
|
|
|
|
my $method = $self->{method}; |
37
|
0
|
|
|
|
|
|
my $language= $i18n->language; |
38
|
0
|
|
|
|
|
|
$memhash->{$class}{$oid}{$method}{$language} = $data; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|