NAME
Kernel::System::Type – type lib
DESCRIPTION
All type functions.
PUBLIC INTERFACE
new()
create an object
my $TypeObject = $Kernel::OM->Get('Kernel::System::Type');
TypeAdd()
add a new ticket type
my $ID = $TypeObject->TypeAdd(
Name => 'New Type',
ValidID => 1,
UserID => 123,
);
TypeGet()
get types attributes
my %Type = $TypeObject->TypeGet(
ID => 123,
);
my %Type = $TypeObject->TypeGet(
Name => 'default',
);
Returns:
Type = (
ID => '123',
Name => 'Service Request',
ValidID => '1',
CreateTime => '2010-04-07 15:41:15',
CreateBy => '321',
ChangeTime => '2010-04-07 15:59:45',
ChangeBy => '223',
);
TypeUpdate()
update type attributes
$TypeObject->TypeUpdate(
ID => 123,
Name => 'New Type',
ValidID => 1,
UserID => 123,
);
TypeList()
get type list
my %List = $TypeObject->TypeList();
or
my %List = $TypeObject->TypeList(
Valid => 0,
);
TypeLookup()
get id or name for a ticket type
my $Type = $TypeObject->TypeLookup( TypeID => $TypeID );
my $TypeID = $TypeObject->TypeLookup( Type => $Type );
NameExistsCheck()
return 1 if another type with this name already exits
$Exist = $TypeObject->NameExistsCheck(
Name => 'Some::Template',
ID => 1, # optional
);