Kernel::System::FAQ::State

NAME

Kernel::System::FAQ::State – sub module of Kernel::System::FAQ

DESCRIPTION

All FAQ state functions.

PUBLIC INTERFACE

StateAdd()

add a state

    my $Success = $FAQObject->StateAdd(
        Name   => 'public',
        TypeID => 1,
        UserID => 1,
    );

Returns:

    $Success = 1;               # or undef if state could not be added

StateGet()

get a state as hash

    my %State = $FAQObject->StateGet(
        StateID => 1,
        UserID  => 1,
    );

Returns:

    %State = (
        StateID => 1,
        Name    => 'internal (agent)',
        TypeID  => 1,
    );

StateList()

get the state list as hash

    my %States = $FAQObject->StateList(
        UserID => 1,
    );

optional, get state list for some state types:

    my %States = $FAQObject->StateList(
        Types  => [ 'public', 'internal'],
        UserID => 1,
    );

Returns:

    %States = (
        1 => 'internal (agent)',
        2 => 'external (customer)',
        3 => 'public (all)',
    );

StateUpdate()

update a state

    my Success = $FAQObject->StateUpdate(
        StateID => 1,
        Name    => 'public',
        TypeID  => 1,
        UserID  => 1,
    );

Returns:

    Success = 1;             # or undef if state could not be updated

StateTypeGet()

get a state as hash reference

    my $StateTypeHashRef = $FAQObject->StateTypeGet(
        StateID => 1,
        UserID  => 1,
    );

Or

    my $StateTypeHashRef = $FAQObject->StateTypeGet(
        Name    => 'internal',
        UserID  => 1,
    );

Returns:

    $StateTypeHashRef = {
        'StateID' => 1,
        'Name'    => 'internal',
    };

StateTypeList()

get the state type list as hash reference

    my $StateTypeHashRef = $FAQObject->StateTypeList(
        UserID => 1,
    );

optional, get state type list for some states:

    my $StateTypeHashRef = $FAQObject->StateTypeList(
        Types  => [ 'public', 'internal'],
        UserID => 1,
    );

Returns:

    $StateTypeHashRef = {
        1 => 'internal',
        3 => 'public',
        2 => 'external',
    };
Scroll to Top