
####
Type
####


****
NAME
****


Kernel::System::Type - type lib


***********
DESCRIPTION
***********


All type functions.


****************
PUBLIC INTERFACE
****************


new()
=====


create an object


.. code-block:: perl

     my $TypeObject = $Kernel::OM->Get('Kernel::System::Type');



TypeAdd()
=========


add a new ticket type


.. code-block:: perl

     my $ID = $TypeObject->TypeAdd(
         Name    => 'New Type',
         ValidID => 1,
         UserID  => 123,
     );



TypeGet()
=========


get types attributes


.. code-block:: perl

     my %Type = $TypeObject->TypeGet(
         ID => 123,
     );
 
     my %Type = $TypeObject->TypeGet(
         Name => 'default',
     );


Returns:


.. code-block:: perl

     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


.. code-block:: perl

     $TypeObject->TypeUpdate(
         ID      => 123,
         Name    => 'New Type',
         ValidID => 1,
         UserID  => 123,
     );



TypeList()
==========


get type list


.. code-block:: perl

     my %List = $TypeObject->TypeList();


or


.. code-block:: perl

     my %List = $TypeObject->TypeList(
         Valid => 0,
     );



TypeLookup()
============


get id or name for a ticket type


.. code-block:: perl

     my $Type = $TypeObject->TypeLookup( TypeID => $TypeID );
 
     my $TypeID = $TypeObject->TypeLookup( Type => $Type );



NameExistsCheck()
=================



.. code-block:: perl

     return 1 if another type with this name already exits
 
         $Exist = $TypeObject->NameExistsCheck(
             Name => 'Some::Template',
             ID   => 1,                  # optional
         );





