Class Category
For accessing and changing a ticket category.
Examples
Category c;
c.load(2); //Loads category with ID = 2
print(c.getValue("notificationEmail"));
c.setValue("name", "Bob");
Constructors
Category()
Initializes a new instance of the Category class.
Declaration
Category Methods
getValue(String)
Retrieves the value of the given field in the category.
Declaration
String getValue(String field) Examples
Category c;
c.load(2);
print(c.getValue("notificationEmail"))
Parameters
| Type | Name | Description |
| String | field | The field to get. |
Returns
| Type | Description |
| String | The value of the specified field. |
load(Integer)
Load object with values from category with given ID.
Declaration
Bool load(Integer id) Examples
Category c;
c.load(2);
print(c.getValue("name"));
Parameters
| Type | Name | Description |
| Integer | id | The ID of the category to load. |
Returns
| Type | Description |
| Bool | True if the category exists; otherwise, false. |
save()
Saves the category and returns its ID.
Declaration
Integer save() Returns
| Type | Description |
| Integer | The ID of the saved category. |
setValue(String,String)
Sets the value of the given field for the category.
Declaration
Void SetValue(String name, String value) Examples
Category c;
c.load(2);
c.setValue("name", "Test");
Parameters
| Type | Name | Description |
| String | name | The field to set. |
| String | value | The value to set. |
Returns
| Type | Description |