From: Sven Schöling Date: Thu, 15 Nov 2012 14:10:12 +0000 (+0100) Subject: set_data Methode X-Git-Tag: release-3.1.0beta1~737 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=aba17eb108de08afb421ca3be47c5ce4b0d2be44;p=kivitendo-erp.git set_data Methode --- diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index 9f2f7cb05..1a9c86922 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -5,10 +5,10 @@ use strict; use DateTime::Event::Cron; use English qw(-no_match_vars); -use SL::DB::MetaSetup::BackgroundJob; -use SL::DB::Manager::BackgroundJob; +require SL::DB::MetaSetup::BackgroundJob; +require SL::DB::Manager::BackgroundJob; -use SL::DB::BackgroundJobHistory; +require SL::DB::BackgroundJobHistory; use SL::System::Process; @@ -77,6 +77,14 @@ sub data_as_hash { return {}; } +sub set_data { + my ($self, %data) = @_; + + my $data = YAML::Load($self->data); + $data->{$_} = $data{$_} for keys %data; + $self->data(YAML::Dump($data)); +} + sub validate { my ($self) = @_;