Kernel::System::SystemData - key/value store for system data
Provides key/value store for system data
Don't use the constructor directly, use the ObjectManager instead:
my $SystemDataObject = $Kernel::OM->Get('Kernel::System::SystemData');
add a new SystemData
value.
Result is true if adding was OK, and false if it failed, for instance because the key already existed.
If your keys contain '::' this will be used as a separator. This allows you to later for instance fetch all keys that start with 'SystemRegistration::' in one go, using SystemDataGetGroup().
my $Result = $SystemDataObject->SystemDataAdd( Key => 'SomeKey', Value => 'Some Value', UserID => 123, ); my $Result = $SystemDataObject->SystemDataAdd( Key => 'SystemRegistration::Version', Value => 'Some Value', UserID => 123, );
get system data for key
my $SystemData = $SystemDataObject->SystemDataGet( Key => 'OTRS Version', );
returns value as a simple scalar, or undef if the key does not exist. keys set to NULL return an empty string.
returns a hash of all keys starting with the Group. For instance the code below would return values for 'SystemRegistration::UniqueID', 'SystemRegistration::UpdateID', and so on.
my %SystemData = $SystemDataObject->SystemDataGroupGet( Group => 'SystemRegistration', );
returns
%SystemData = ( UniqueID => 'CDC782BE-E483-11E2-83DA-9FFD99890B3C', UpdateID => 'D8F55850-E483-11E2-BD60-9FFD99890B3C' ... );
update system data
Returns true if update was successful or false if otherwise - for instance if key did not exist.
my $Result = $SystemDataObject->SystemDataUpdate( Key => 'OTRS Version', Value => 'Some New Value', UserID => 123, );
update system data
Returns true if delete was successful or false if otherwise - for instance if key did not exist.
$SystemDataObject->SystemDataDelete( Key => 'OTRS Version', UserID => 123, );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.