Kernel::System::ServiceCatalogue::Category

NAME

Kernel::System::ServiceCatalogue::Category

DESCRIPTION

All Service Catalogue Category functions.

PUBLIC INTERFACE

BUILD()

Customization of object construction, do not use it directly.

CategoryAdd()

Adds new Category in Service Catalogue.

    my $Success = $CategoryObject->CategoryAdd(
        Title    => 'Category Name',        # (required) Title
        Language => 'de',                   # (required) Language
        ValidID  => 1,                      # (required) ValidID
        UserID   => 1,                      # (required) UserID
        ParentID => 123,                    # (optional) Parent Category ID
    );

CategoryGet()

Get Category data.

    my %Category = $CategoryObject->CategoryGet(
        CategoryID => 1,            # (required) Category ID.
    );

Returns:

    %Category = (
        CategoryID    => 1,
        Title         => 'Category name',
        CreateBy      => 1,
        CreateTime    => '2018-07-20 12:00:00',
        ChangeBy      => 1,
        ChangeTime    => '2018-07-20 12:00:00',
        ValidID       => 1,
        ParentID      => 123,
        Language      => 'de',
    );

CategoryList()

Lists Categories in Service Catalogue.

    my @Categories = $CategoryObject->CategoryList(
        RootOnly    => 1,            # (optional) List only root Categories
        ParentID    => 1,            # (optional) List of child Categories for given parent
        Valid       => 1,            # (optional) Show only Valid Categories
        Language    => 'de',         # (optional) Filter by Language
    );

Returns:

    @Categories = (
        {
            CategoryID    => 1,
            Title         => 'Category name',
            Language      => 'de',
            CreateBy      => 1,
            CreateTime    => '2018-07-20 12:00:00',
            ChangeBy      => 1,
            ChangeTime    => '2018-07-20 12:00:00',
            ValidID       => 1,
            ParentID      => 123,
        },
        ...
    );

CategoryDelete()

Lists Categories in Service Catalogue.

    my $Success = $CategoryObject->CategoryDelete(
        CategoryID  => 1,            # (required) Category ID to be deleted.
    );

CategoryUpdate()

Update Category in Service Catalogue.

    my $Success = $CategoryObject->CategoryUpdate(
        CategoryID  => 1,                   # (required) Category ID to be updated.
        Title       => 'Category name',     # (required) Category title
        ParentID    => 123,                 # (required) ParentID
        Language    => 'Language',          # (required) Language
        ValidID     => 2,                   # (required) ValidID
        UserID      => 1,                   # (required) UserID
    );

ChildrenLanguageGet()

Return language of the child categories (if any). If there are no children, returns undef.

    my $Language = $CategoryObject->ChildrenLanguageGet(
        CategoryID  => 1,                   # (required) Category ID to be updated.
    );

Returns: $Language = 'en'; # Language or undef.

CategoryFlatTree()

Get the category list as a flat two level hierarchical tree

    my $CategoryHashRef = $CategoryObject->CategoryFlatTree(
        UserID => 1,
    );

Returns:

    $CategoryHashRef = {
        0 => {
            1 => 'Misc',
            2 => 'My Category',
        },
        2 => {
            3 => 'Sub Category A',
            4 => 'Sub Category B',
        },
    };
Scroll to Top