Kernel::System::Lock

NAME

Kernel::System::Lock – lock lib

DESCRIPTION

All lock functions.

The whole lock API is just for "reading" lock states. By default, there is "unlock", "lock" and "lock-tmp". Usually you would not modify those lock states, because there is no use case for this.

PUBLIC INTERFACE

new()

create an object

    my $LockObject = $Kernel::OM->Get('Kernel::System::Lock');

LockViewableLock()

get list of view-able lock types (used to show available tickets)

    my @List = $LockObject->LockViewableLock(
        Type => 'Name', # ID|Name
    );

Returns:

    @List = ( 'unlock', 'lock', 'lock-tmp' );

    my @ListID = $LockObject->LockViewableLock(
        Type => 'ID', # ID|Name
    );

Returns:

    @List = ( 1, 2, 3 );

LockLookup()

lock state lookup by ID or Name

    my $LockID = $LockObject->LockLookup( Lock => 'lock' );

    my $Lock = $LockObject->LockLookup( LockID => 2 );

LockList()

get lock state list

    my %List = $LockObject->LockList(
        UserID => 123,
    );

Returns:

    %List = (
        1 => 'unlock',
        2 => 'lock',
        3 => 'tmp_lock',
    );
Scroll to Top