From aba17eb108de08afb421ca3be47c5ce4b0d2be44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 15 Nov 2012 15:10:12 +0100 Subject: [PATCH] set_data Methode --- SL/DB/BackgroundJob.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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) = @_; -- 2.20.1