65 |
confess "need ID" unless $ID; |
confess "need ID" unless $ID; |
66 |
confess "need state" unless $state; |
confess "need state" unless $state; |
67 |
|
|
|
|
|
68 |
if ( my $o = $self->db->get( $ID ) ) { |
if ( my $o = $self->db->get( $ID ) ) { |
69 |
warn "## update state of $ID\n" if $self->debug; |
warn "## update state of $ID\n" if $self->debug; |
70 |
$o->import( $state ); |
$o->import( $state ); |
74 |
} |
} |
75 |
|
|
76 |
} |
} |
77 |
|
|
78 |
|
=head2 state |
79 |
|
|
80 |
|
my $state = $store->state( $ID ); |
81 |
|
|
82 |
|
Returns normal unblessed hash (actually, in-memory copy of state in database). |
83 |
|
|
84 |
|
=cut |
85 |
|
|
86 |
|
sub state { |
87 |
|
my $self = shift; |
88 |
|
my ( $ID ) = @_; |
89 |
|
confess "need ID" unless $ID; |
90 |
|
return $self->db->get( $ID )->export; |
91 |
|
} |
92 |
|
|
93 |
1; |
1; |