Kayako Ticket object.

All objects interacting with Kayako REST API should extend this class and define: * Kayako controller * XML element name holding object's data in REST response

author Tomasz Sawicki (https://github.com/Furgas)
link http://wiki.kayako.com/display/DEV/REST+-+Ticket
since Kayako version 4.40.1079
package Object\Ticket

 Methods

Default constructor.

__construct(array $data) 
Inherited

inherited_from \kyObjectBase::__construct()
inherited_from \kyObjectWithCustomFieldsBase::__construct()

Parameters

$data

array

Object data from XML response converted into array.

Returns API field value.

__get(string $api_field_name) : mixed
Inherited

Returns API field value based on API field name used by Kayako.

link http://wiki.kayako.com/display/DEV/REST+API+Reference
inherited_from \kyObjectBase::__get()
inherited_from \kyObjectWithCustomFieldsBase::__get()

Parameters

$api_field_name

string

API field name.

Returns

mixed

Sets API field value.

__set(string $api_field_name, mixed $value) : mixed
Inherited

Sets API field value based on API field name used by Kayako.

link http://wiki.kayako.com/display/DEV/REST+API+Reference
inherited_from \kyObjectBase::__set()
inherited_from \kyObjectWithCustomFieldsBase::__set()

Parameters

$api_field_name

string

API field name.

$value

mixed

API field value.

Returns

mixed

Returns object description with it's type and identifier.

__toString() : string
Inherited

Calls toString() method to get the object description.

inherited_from \kyObjectBase::__toString()
inherited_from \kyObjectWithCustomFieldsBase::__toString()

Returns

string

Should build the array of object data for creating or updating the object.

buildData(bool $create) : array

Values must be set in format accepted by REST API.

Parameters

$create

bool

Indicates if the result will be used to create (true) or update (false) an object.

Returns

array

Checks wheter this object has all required fields set.

checkRequiredAPIFields(bool $create, bool $throw_exception) : string[] | bool
Inherited

inherited_from \kyObjectBase::checkRequiredAPIFields()
inherited_from \kyObjectWithCustomFieldsBase::checkRequiredAPIFields()

Parameters

$create

bool

True when object will be created. False when object will be updated.

$throw_exception

bool

True to throw an exception on missing fields. False to return list of missing fields or true when there are none.

Exceptions

\kyException When there are missing field values and $throw_exception is true.

Returns

string[]boolList of missing API fields or true when there are none.

Creates an object on the server and refreshes its local data.

create() : \kyObjectBase
Inherited

inherited_from \kyObjectBase::create()
inherited_from \kyObjectWithCustomFieldsBase::create()

Exceptions

\BadMethodCallException
\kyException

Returns

Creates new ticket with implicit user or staff as creator.

createNew(\kyDepartment $department, \kyUser | \kyStaff $creator, string $contents, string $subject) : \kyTicket

WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.

Parameters

$department

\kyDepartment

Department where new ticket will be created.

$creator

\kyUser\kyStaff

Creator (User or Staff) of new ticket.

$contents

string

Contents of the first post.

$subject

string

Subject of new ticket.

Returns

Creates new ticket with creator user automatically created by server using provided name and e-mail.

createNewAuto(\kyDepartment $department, string $creator_full_name, string $creator_email, string $contents, string $subject) : \kyTicket

WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.

Parameters

$department

\kyDepartment

Department where new ticket will be created.

$creator_full_name

string

Creator full name.

$creator_email

string

Creator e-mail.

$contents

string

Contents of the first post.

$subject

string

Subject of new ticket.

Returns

Deletes the object on the server.

delete() 
Inherited

inherited_from \kyObjectBase::delete()
inherited_from \kyObjectWithCustomFieldsBase::delete()

Fetches the object from server.

get(int | array $id) : \kyObjectBase
Inherited

inherited_from \kyObjectBase::get()
inherited_from \kyObjectWithCustomFieldsBase::get()

Parameters

$id

intarray

Object identifier or list of identifiers (ex. ticket identifier and ticket post identifier when fetching TicketPost).

Returns

Returns array of API fields.

getAPIFields() : string[]
Inherited

Format of returned array:

array(
    '' => Field description. (getter: , setter: ),
    ...repeat...
)

inherited_from \kyObjectBase::getAPIFields()
inherited_from \kyObjectWithCustomFieldsBase::getAPIFields()

Returns

string[]

Searches for tickets based on provided data.

getAll(\kyDepartment | \kyResultSet $departments, array | \kyResultSet | \kyTicketStatus $ticket_statuses, array | \kyResultSet | \kyStaff $owner_staffs, array | \kyResultSet | \kyUser $users) : \kyResultSet

You must provide at least one department identifier.

Parameters

$departments

\kyDepartment\kyResultSet

Non-empty list of department identifiers.

$ticket_statuses

array\kyResultSet\kyTicketStatus

List of ticket status identifiers.

$owner_staffs

array\kyResultSet\kyStaff

List of staff (ticket owners) identifiers.

$users

array\kyResultSet\kyUser

List of user (ticket creators) identifiers.

Exceptions

\InvalidArgumentException

Returns

Returns list of attachments in all posts of this ticket.

getAttachments(bool $reload) : \kyTicketAttachment[]

Result is cached till the end of script.

Parameters

$reload

bool

True to reload attachments from server.

Returns

Returns list of available filter methods for use in result sets with objects of this type.

getAvailableFilterMethods(bool $filter_names_only) : array
Inherited

Optionaly you can return get method names used to filter objects.

inherited_from \kyObjectBase::getAvailableFilterMethods()
inherited_from \kyObjectWithCustomFieldsBase::getAvailableFilterMethods()

Parameters

$filter_names_only

bool

True (default) to return array('filterByXXX', 'filterByYYY', ...). False to return array('filterByXXX' => 'getXXX', 'filterByYYY' => 'YYY', ...).

Returns

array

Returns list of available order methods for use in result sets with objects of this type.

getAvailableOrderMethods(bool $order_names_only) : array
Inherited

Optionaly you can return get method names used to order objects.

inherited_from \kyObjectBase::getAvailableOrderMethods()
inherited_from \kyObjectWithCustomFieldsBase::getAvailableOrderMethods()

Parameters

$order_names_only

bool

True (default) to return array('orderByXXX', 'orderByYYY', ...). False to return array('orderByXXX' => 'getXXX', 'orderByYYY' => 'YYY', ...).

Returns

array

Returns object controller.

getController() : string
Inherited

inherited_from \kyObjectBase::getController()
inherited_from \kyObjectWithCustomFieldsBase::getController()

Returns

string

Returns creation mode.

getCreationMode() : int

see \global\kyTicket::CREATION_MODE
filterBy
orderBy

Returns

int

Returns date and time this ticket was created.

getCreationTime(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns creation type.

getCreationType() : int

see \global\kyTicket::CREATION_TYPE
filterBy
orderBy

Returns

int

Returns creator type.

getCreatorType() : int

see \global\kyTicket::CREATOR
filterBy
orderBy

Returns

int

Returns custom field based on its name.

getCustomField(string $name) : \kyCustomField
Inherited

inherited_from \kyObjectWithCustomFieldsBase::getCustomField()

Parameters

$name

string

Field name.

Returns

Returns list of custom fields groups.

getCustomFieldGroups(bool $reload) : \kyResultSet
Inherited

Result is cached until the end of script.

inherited_from \kyObjectWithCustomFieldsBase::getCustomFieldGroups()

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns value of this custom field.

getCustomFieldValue(string $name) : mixed
Inherited

Value interpretation depends on field type.

inherited_from \kyObjectWithCustomFieldsBase::getCustomFieldValue()

Parameters

$name

string

Field name.

Returns

mixed

Returns list of custom fields.

getCustomFields(bool $reload) : \kyResultSet
Inherited

Result is cached until the end of script.

inherited_from \kyObjectWithCustomFieldsBase::getCustomFields()

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns department object associated with the ticket.

getDepartment(bool $reload) : \kyDepartment

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of department associated with the ticket.

getDepartmentId() : int

filterBy
orderBy

Returns

int

Return display identifier of the ticket.

getDisplayId() : string

filterBy
orderBy

Returns

string

Return the creator e-mail address.

getEmail() : string

filterBy
orderBy

Returns

string

Returns escalation rule identifier.

getEscalationRuleId() : int

filterBy

Returns

int

Returns first post of this ticket.

getFirstPost() : \kyTicketPost

Returns

Returns flag type for the ticket.

getFlagType() : int

see \global\kyTicket::FLAG
filterBy
orderBy

Returns

int

Returns the creator full name.

getFullName() : string

filterBy
orderBy

Returns

string

Returns IP address from which this post was created.

getIPAddress() : string

filterBy
orderBy

Returns

string

Should return object identifier or complete list of identifiers as needed by API to identify the object (ex.

getId(bool $complete) : int | array

ticket identifier and ticket post identifier in case of TicketPost).

Parameters

$complete

bool

True to return complete list of identifiers as needed by API to identify the object.

Returns

intarray

Returns whether this ticket has escalated.

getIsEscalated() : bool

filterBy
orderBy

Returns

bool

Returns date and time of last activity on this ticket.

getLastActivity(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns full name of the last person replied to this ticket.

getLastReplier() : string

filterBy
orderBy

Returns

string

Returns date and time of last staff user reply to this ticket.

getLastStaffReply(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns date and time of last user reply to this ticket.

getLastUserReply(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns next ticket reply due date and time.

getNextReplyDue(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns list of ticket notes.

getNotes(bool $reload) : \kyResultSet

Result is cached till the end of script.

Parameters

$reload

bool

True to reload notes from server.

Returns

Return staff user, owner of this ticket.

getOwnerStaff(bool $reload) : \kyStaff

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of the staff user, owner of this ticket.

getOwnerStaffId() : int

filterBy
orderBy

Returns

int

Returns full name of the staff user, owner of this ticket.

getOwnerStaffName() : string

filterBy
orderBy

Returns

string

Returns list of ticket posts.

getPosts(bool $reload) : \kyResultSet

Result is cached till the end of script.

Parameters

$reload

bool

True to reload posts from server.

Returns

Returns this ticket priority.

getPriority(bool $reload) : \kyTicketPriority

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of this ticket priority.

getPriorityId() : int

filterBy
orderBy

Returns

int

Returns replies count.

getReplies() : int

filterBy
orderBy

Returns

int

Returns list of required API fields for objects of this class.

getRequiredAPIFields(bool $create) : string[]
Inherited

inherited_from \kyObjectBase::getRequiredAPIFields()
inherited_from \kyObjectWithCustomFieldsBase::getRequiredAPIFields()

Parameters

$create

bool

True when object will be created. False when object will be updated.

Returns

string[]

Returns ticket resolution due date and time.

getResolutionDue(string $format) : string

see \global\http://www.php.net/manual/en/function.date.php
filterBy
orderBy

Parameters

$format

string

Output format of the date. If null the format set in client configuration is used.

Returns

string

Returns Service Level Agreement plan identifier.

getSLAPlanId() : int

filterBy

Returns

int

Returns statistics for all tickets in database.

getStatistics(bool $reload) : array

Result is cached. Format or result:

    array(
        'departments' => array( //statistics per department (if there are no tickets in department then there will be no record with its id here)
             => array( //tickets assigned to department with this id
                'last_activity' => ,
                'total_items' => ,
                'total_unresolved_items' => ,
                'ticket_statuses' => array( //statistics per ticket status in the department
                     => array(
                        'last_activity' => ,
                        'total_items' => 
                    ),
                    ...
                ),
                'ticket_types' => array( //statistics per ticket type in the department
                     => array(
                        'last_activity' => ,
                        'total_items' => ,
                        'total_unresolved_items' => ,
                    ),
                    ...,
                    'unknown' => array(  //in Kayako 4.01.204 all ticket types will be unknown beacuse of a bug (http://dev.kayako.com/browse/SWIFT-1465)
                        ...
                    )
                )
                'ticket_owners' => array( //statistics per ticket owner in the department
                     => array(
                        'last_activity' => ,
                        'total_items' => ,
                        'total_unresolved_items' => ,
                    ),
                    ...,
                    'unassigned' => array(  //tickets not assigned to any staff
                        ...
                    )
                )
            ),
            ...,
            'unknown' => array( //tickets in Trash
                ...
            )
        ),
        'ticket_statuses' => array( //statistics per ticket status in all departments
             => array(
                'last_activity' => ,
                'total_items' => 
            ),
            ...
        ),
        'ticket_owners' => array( //statistics per ticket owner in all departments
             => array(
                'last_activity' => ,
                'total_items' => ,
                'total_unresolved_items' => ,
            ),
            ...,
            'unassigned' => array(  //tickets not assigned to any staff no matter what department
                ...
            )
        )
    )

Parameters

$reload

bool

True to reload statistics data from server.

Returns

array

Returns ticket status.

getStatus(bool $reload) : \kyTicketStatus

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of this ticket status.

getStatusId() : int

filterBy
orderBy

Returns

int

Returns the subject of this ticket.

getSubject() : string

filterBy
orderBy

Returns

string

Returns ticket tags.

getTags() : string

filterBy

Returns

string

Returns template group identifier.

getTemplateGroupId() : int

filterBy
orderBy

Returns

int

Returns template group name.

getTemplateGroupName() : string

filterBy
orderBy

Returns

string

Returns list of ticket time tracks.

getTimeTracks(bool $reload) : \kyResultSet

Result is cached till the end of script.

Parameters

$reload

bool

True to reload time tracks from server.

Returns

Returns this ticket type.

getType(bool $reload) : \kyTicketType

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of this ticket type.

getTypeId() : int

filterBy
orderBy

Returns

int

Returns user, the creator of this ticket.

getUser(bool $reload) : \kyUser

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of user, the creator of this ticket.

getUserId() : int

filterBy
orderBy

Returns

int

Return organization the user who created the ticket belongs to.

getUserOrganization(bool $reload) : \kyUserOrganization

Result is cached until the end of script.

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Returns

Returns identifier of organization the user who created the ticket belongs to.

getUserOrganizationId() : int

filterBy
orderBy

Returns

int

Returns name of organization the user who created the ticket belongs to.

getUserOrganizationName() : string

filterBy
orderBy

Returns

string

Returns tickets watchers.

getWatchers() : array

Format of returned array:

array(
  array(
    'staff_id' => ,
    'name' => ''
  ),
  ...
)

Returns

array

Returns tickets workflows.

getWorkflows() : array

Format of returned array:

array(
  array(
    'id' => ,
    'title' => ''
  ),
  ...
)

Returns

array

Returns whether the object is new and not yet saved on the server.

isNew() : bool
Inherited

inherited_from \kyObjectBase::isNew()
inherited_from \kyObjectWithCustomFieldsBase::isNew()

Returns

bool

Returns whether this object is read only.

isReadOnly() : bool
Inherited

inherited_from \kyObjectBase::isReadOnly()
inherited_from \kyObjectWithCustomFieldsBase::isReadOnly()

Returns

bool

Creates new note in this ticket.

newNote(\kyStaff $creator, string $contents) : \kyTicketNote

WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.

Parameters

$creator

\kyStaff

Creator (staff) of new note.

$contents

string

Contents of new note.

Returns

Creates new post in this ticket.

newPost(\kyUser | \kyStaff $creator, string $contents) : \kyTicketPost

WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.

Parameters

$creator

\kyUser\kyStaff

Creator (User or Staff) of new post.

$contents

string

Contents of new post.

Returns

Creates new ticket time track for this ticket.

newTimeTrack(string $contents, \kyStaff $staff, string $time_worked, string $time_billable) : \kyTicketTimeTrack

WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.

Parameters

$contents

string

Note contents.

$staff

\kyStaff

Staff user - both creator and worker.

$time_worked

string

Worked time formatted as hh:mm. Work date will be set to current datetime.

$time_billable

string

Billable time formatted as hh:mm. Bill date will be set to current datetime.

Returns

Refreshes the object data from server.

refresh() : \kyObjectBase
Inherited

inherited_from \kyObjectBase::refresh()
inherited_from \kyObjectWithCustomFieldsBase::refresh()

Exceptions

\BadMethodCallException

Returns

Saves (creates or updates) the object to the server.

save() : \kyObjectBase
Inherited

inherited_from \kyObjectBase::save()
inherited_from \kyObjectWithCustomFieldsBase::save()

Returns

Sets the contents of this ticket (first ticket post).

setContents(string $contents) : \kyTicket

Parameters

$contents

string

Ticket contents.

Returns

Sets the creation type for this ticket.

setCreationType(int $creation_type) : \kyTicket

see \global\kyTicket::CREATION_TYPE

Parameters

$creation_type

int

Creation type.

Returns

Sets the creator (User or Staff) of this post.

setCreator(int | \kyUser | \kyStaff $creator, int $type) : \kyTicket

see \global\kyTicket::CREATOR

Parameters

$creator

int\kyUser\kyStaff

User identifier OR staff identifier OR user OR staff user.

$type

int

Creator type. Required only when $creator is an identifier.

Returns

Sets the creator to be automatically created (or assigned) by the server based on specified data.

setCreatorAuto(string $full_name, string $email) : \kyTicket

Parameters

$full_name

string

Full name of the creator.

$email

string

E-mail of the creator.

Returns

Sets custom field value.

setCustomFieldValue(string $name, mixed $value) : \kyObjectWithCustomFieldsBase
Inherited

inherited_from \kyObjectWithCustomFieldsBase::setCustomFieldValue()

Parameters

$name

string

Field name.

$value

mixed

New field value.

Returns

Sets custom field values using POST data from current PHP request.

setCustomFieldValuesFromPOST() 
Inherited

inherited_from \kyObjectWithCustomFieldsBase::setCustomFieldValuesFromPOST()

Exceptions

\Exception

Sets default status, priority and type for newly created tickets.

setDefaults(int $status_id, int $priority_id, int $type_id, bool $auto_create_user) 

Parameters

$status_id

int

Default ticket status identifier.

$priority_id

int

Default ticket priority identifier.

$type_id

int

Default ticket type identifier.

$auto_create_user

bool

True to automatically create user if none is provided as creator. False otherwise.

Sets the department the ticket belongs to.

setDepartment(\kyDepartment $department) : \kyTicket

Parameters

$department

\kyDepartment

Department.

Returns

Sets identifier of department the ticket belongs to.

setDepartmentId(int $department_id) : \kyTicket

Parameters

$department_id

int

Department identifier.

Returns

Sets the creator e-mail address.

setEmail(string $email) : \kyTicket

Parameters

$email

string

Creator e-mail.

Returns

Sets the creator full name.

setFullName(string $full_name) : \kyTicket

Parameters

$full_name

string

Creator full name.

Returns

Sets whether to ignore (disable) autoresponder e-mail.

setIgnoreAutoResponder(bool $ignore_auto_responder) : \kyTicket

Parameters

$ignore_auto_responder

bool

Whether to ignore (disable) autoresponder e-mail.

Returns

Sets staff user, owner of this ticket.

setOwnerStaff(\kyStaff $owner_staff) : \kyTicket

Parameters

$owner_staff

\kyStaff

Staff user.

Returns

Sets identifier of the staff user, owner of this ticket.

setOwnerStaffId(int $owner_staff_id) : \kyTicket

Parameters

$owner_staff_id

int

Staff user identifier.

Returns

Sets this ticket priority.

setPriority(\kyTicketPriority $ticket_priority) : \kyTicket

Parameters

$ticket_priority

\kyTicketPriority

Returns

Sets identifier of this ticket priority.

setPriorityId(int $ticket_priority_id) : \kyTicket

Parameters

$ticket_priority_id

int

Ticket priority identifier.

Returns

Sets whether this object is read only.

setReadOnly(bool $read_only) : bool
Inherited

inherited_from \kyObjectBase::setReadOnly()
inherited_from \kyObjectWithCustomFieldsBase::setReadOnly()

Parameters

$read_only

bool

Read only flag.

Returns

bool

Sets staff user, the creator of this ticket.

setStaff(\kyStaff $staff) : \kyTicketPost

Parameters

$staff

\kyStaff

Staff user.

Returns

Sets identifier of staff user, the creator of this ticket.

setStaffId(int $staff_id) : \kyTicketPost

Parameters

$staff_id

int

Staff user identifier.

Returns

Sets ticket status.

setStatus(\kyTicketStatus $ticket_status) : \kyTicket

Parameters

$ticket_status

\kyTicketStatus

Ticket status.

Returns

Sets identifier of this ticket status.

setStatusId(int $ticket_status_id) : \kyTicket

Parameters

$ticket_status_id

int

Ticket status identifier.

Returns

Sets the subject of this ticket.

setSubject(string $subject) : \kyTicket

Parameters

$subject

string

Ticket subject.

Returns

Sets the template group.

setTemplateGroup(string | int $template_group_id_or_name) : \kyTicket

You can provide name or identifier.

Parameters

$template_group_id_or_name

stringint

Template group name or identifier.

Returns

Sets the template group identifier.

setTemplateGroupId(int $template_group_id) : \kyTicket

Resets template group name.

Parameters

$template_group_id

int

Template group identifier.

Returns

Sets the template group name.

setTemplateGroupName(string $template_group_name) : \kyTicket

Resets template group identifier.

Parameters

$template_group_name

string

Template group name.

Returns

Sets this ticket type.

setType(\kyTicketType $ticket_type) : \kyTicket

Parameters

$ticket_type

\kyTicketType

Ticket type.

Returns

Sets identifier of this ticket type.

setTypeId(int $ticket_type_id) : \kyTicket

Parameters

$ticket_type_id

int

Ticket type identifier.

Returns

Sets user, the creator of this post.

setUser(\kyUser $user) : \kyTicketPost

Parameters

$user

\kyUser

User.

Returns

Sets identifier of user, the creator of this ticket.

setUserId(int $user_id) : \kyTicket

Parameters

$user_id

int

User identifier.

Returns

Should return short (one line) description of the object (it's title, name, etc.).

toString() : string

Returns

string

Adds updating custom fields to base object update.

update() : \kyObjectBase
Inherited

see \global\kyObjectBase::update()
inherited_from \kyObjectWithCustomFieldsBase::update()

Exceptions

\BadMethodCallException
\kyException

Returns

Updates all custom fields values on Kayako server.

updateCustomFields() : \kyObjectWithCustomFieldsBase
Inherited

inherited_from \kyObjectWithCustomFieldsBase::updateCustomFields()

Returns

Returns REST client.

getRESTClient() : \kyRESTClientInterface
Inherited

inherited_from \kyObjectBase::getRESTClient()
inherited_from \kyObjectWithCustomFieldsBase::getRESTClient()

Returns

Returns list of custom field groups for this object.

loadCustomFieldGroups(bool $reload) : \kyResultSet
Inherited

Result is cached until the end of script.

inherited_from \kyObjectWithCustomFieldsBase::loadCustomFieldGroups()

Parameters

$reload

bool

True to reload data from server. False to use the cached value (if present).

Exceptions

\BadMethodCallException

Returns

Should use passed data to fill object properties.

parseData(array $data) 

Parameters

$data

array

Object data from XML response.

Generic method for creating new ticket (without setting creator).

createNewGeneric(\kyDepartment $department, string $contents, string $subject) : \kyTicket

Parameters

$department

\kyDepartment

Department where new ticket will be created.

$contents

string

Contents of the first post.

$subject

string

Subject of new ticket.

Returns

Builds API fields list.

initAPIFieldsAccessors() 
Inherited

Scans protected and private properties of called class, searches for

apiField [name=field name] [accessor=setter/getter name] [getter=getter name] [setter=setter name] [required_create=true if field if required when creating object] [required_update=true if field if required when udpating object] [required=true if field if required when creating or updating object] and builds API field list with property name, description, setter and getter method names, and required flags.
see \global\kyObjectBase::$_api_fields
inherited_from \kyObjectBase::initAPIFieldsAccessors()
inherited_from \kyObjectWithCustomFieldsBase::initAPIFieldsAccessors()

Prepares local array for custom field fast lookup based on its name.

initFields() 
Inherited

inherited_from \kyObjectWithCustomFieldsBase::initFields()

 Properties

 

Cache for available filter methods.

$_filter_methods : string[]
Inherited

Format: array( '' => array( '' => '', ...repeat for every filtering enabled method... ), ...repeat for every object class... )

inherited_from \kyObjectBase::$$_filter_methods
inherited_from \kyObjectWithCustomFieldsBase::$$_filter_methods
 

Cache for available order methods.

$_order_methods : string[]
Inherited

Format: array( '' => array( '' => '', ...repeat for every ordering enabled method... ), ...repeat for every object class... )

inherited_from \kyObjectBase::$$_order_methods
inherited_from \kyObjectWithCustomFieldsBase::$$_order_methods
 

Ticket contents.

$contents : string

apiField required_create=true
 

Default Kayako controller used to operate on this objects.

$controller : string

Override in descending classes.

 

Ticket creation mode.

$creation_mode : int

see \global\kyTicket::CREATION_MODE
apiField
 

Timestamp of when this ticket was created.

$creation_time : int

apiField
 

Ticket creation type.

$creation_type : int

see \global\kyTicket::CREATION_TYPE
apiField alias=type
 

Type of the ticket creator.

$creator : int

see \global\kyTicket::CREATOR
apiField
 

Name of class representing object custom field group.

$custom_field_group_class : string

 

Object custom field groups.

$custom_field_groups : \kyResultSet
Inherited

inherited_from \kyObjectWithCustomFieldsBase::$$custom_field_groups
 

For fast lookup of custom fields based on their name.

$custom_fields : array
Inherited

inherited_from \kyObjectWithCustomFieldsBase::$$custom_fields
 

Ticket department identifier.

$department_id : int

apiField required_create=true
 

Ticket display identifier.

$display_id : string

apiField
 

E-mail of creator of the ticket.

$email : string

apiField required_create=true
 

Escalation rule identifier.

$escalation_rule_id : int

apiField
 

Ticket flag type.

$flag_type : int

see \global\kyTicket::FLAG
apiField
 

Full name of creator of the ticket.

$full_name : int

apiField required_create=true
 

Ticket identifier.

$id : int

apiField
 

Option to disable autoresponder e-mail.

$ignore_auto_responder : bool

apiField
 

IP address from which the ticket was created.

$ip_address : string

apiField
 

Is this ticket escalated.

$is_escalated : bool

apiField
 

Timestamp of last activity in this ticket.

$last_activity : int

apiField
 

Full name of the last replier to this ticket.

$last_replier : string

apiField
 

Timestamp of last staff user reply.

$last_staff_reply : int

apiField
 

Timestamp of last user reply.

$last_user_reply : int

apiField
 

Timestamp of when the next replay is due.

$next_reply_due : int

apiField
 

Name of URL parameter for sending object identifier.

$object_id_field : string

 

Indicates the name of object element in XML response.

$object_xml_name : string

Override in descending classes.

 

Identifier of staff user who owns the ticket.

$owner_staff_id : int

apiField
 

Full name of staff user who owns the ticket.

$owner_staff_name : string

apiField
 

Ticket priority identifier.

$priority_id : int

apiField required_create=true
 

Controls if the object can be created/updated/deleted.

$read_only : bool
Inherited

Override in descending classes.

inherited_from \kyObjectBase::$$read_only
inherited_from \kyObjectWithCustomFieldsBase::$$read_only
 

Reply count.

$replies : int

apiField
 

Timestamp of when resolution of the ticket is due.

$resolution_due : int

apiField
 

Service Level Agreement plan identifier.

$sla_plan_id : int

apiField
 

Identifier os staff user who will create this ticket.

$staff_id : int

apiField
 

Ticket status identifier.

$status_id : int

apiField required_create=true
 

Ticket subject.

$subject : string

apiField required_create=true
 

Ticket tags.

$tags : string

apiField
 

Template group identifier.

$template_group_id : int

apiField getter=getTemplateGroupId setter=setTemplateGroup alias=templategroup
 

Template group name.

$template_group_name : string

apiField getter=getTemplateGroupName setter=setTemplateGroup
 

Ticket type identifier.

$type_id : int

apiField required_create=true
 

Identifier of the user ticket was created by.

$user_id : int

apiField
 

Identifier of the organization of the user ticket was created by.

$user_organization_id : int

apiField
 

Name of the organization of the user ticket was created by.

$user_organization_name : string

apiField
 

Ticket watchers.

$watchers : array

apiField
 

Ticket workflows.

$workflows : array

apiField
 

Cache for API fields.

$_api_fields : array
Inherited

Format: array( '' => array( '' => array( 'property' => '', 'description' => '', 'getter' => '', 'setter' => '', 'required_create' => , 'required_update' => ), ...repeat for every class api field... ), ...repeat for every object class... )

inherited_from \kyObjectBase::$$_api_fields
inherited_from \kyObjectWithCustomFieldsBase::$$_api_fields
 

List of ticket attachments.

$attachments : \kyTicketAttachment[]

 

Default status identifier for new tickets.

$auto_create_user : int

see \global\kyTicket::setDefaults
 

Default priority identifier for new tickets.

$default_priority_id : int

see \global\kyTicket::setDefaults
 

Default status identifier for new tickets.

$default_status_id : int

see \global\kyTicket::setDefaults
 

Default type identifier for new tickets.

$default_type_id : int

see \global\kyTicket::setDefaults
 

Department of this ticket.

$department : \kyDepartment

 

List of ticket notes.

$notes : \kyTicketNote[]

 

Staff user who is the owner of this ticket.

$owner_staff : \kyStaff

 

List of ticket posts.

$posts : \kyTicketPost[]

 

Ticket priority.

$priority : \kyTicketPriority

 

Staff user, the creator of this ticket.

$staff : \kyStaff

 

Tickets statistic.

$statistics : array

 

Ticket status.

$status : \kyTicketStatus

 

List of ticket time tracks.

$time_tracks : \kyTicketTimeTrack[]

 

Ticket type.

$type : \kyTicketType

 

User, the creator of this ticket.

$user : \kyUser

 

Organization of user who created this ticket.

$user_organization : \kyUserOrganization

 Constants

 

CREATION_MODE_API

CREATION_MODE_API 

 

CREATION_MODE_EMAIL

CREATION_MODE_EMAIL 

 

CREATION_MODE_SITEBADGE

CREATION_MODE_SITEBADGE 

 

CREATION_MODE_STAFFCP

CREATION_MODE_STAFFCP 

 

CREATION_MODE_SUPPORTCENTER

CREATION_MODE_SUPPORTCENTER 

 

CREATION_TYPE_DEFAULT

CREATION_TYPE_DEFAULT 

 

CREATION_TYPE_PHONE

CREATION_TYPE_PHONE 

 

CREATOR_AUTO

CREATOR_AUTO 

 

CREATOR_CLIENT

CREATOR_CLIENT 

 

CREATOR_STAFF

CREATOR_STAFF 

 

CREATOR_USER

CREATOR_USER 

 

Data key for storing files to send as multipart/form-data.

FILES_DATA_NAME : string
Inherited

inherited_from \kyObjectBase::FILES_DATA_NAME
inherited_from \kyObjectWithCustomFieldsBase::FILES_DATA_NAME
 

FLAG_BLUE

FLAG_BLUE 

 

FLAG_GREEN

FLAG_GREEN 

 

FLAG_NONE

FLAG_NONE 

 

FLAG_ORANGE

FLAG_ORANGE 

 

FLAG_PURPLE

FLAG_PURPLE 

 

FLAG_RED

FLAG_RED 

 

FLAG_YELLOW

FLAG_YELLOW 

 

Flag for searching using query - search the Full Name & Email.

SEARCH_AUTHOR : string

 

Flag for searching using query - search the Ticket Post Contents.

SEARCH_CONTENTS : string

 

Flag for searching using query - search the Email Address (only Tickets).

SEARCH_CREATOR_EMAIL : string

 

Flag for searching using query - search the Email Address (Ticket & Posts).

SEARCH_EMAIL : string

 

Flag for searching using query - search the Full Name.

SEARCH_FULL_NAME : string

 

Flag for searching using query - search the Ticket Notes.

SEARCH_NOTES : string

 

Flag for searching using query - search the Ticket Tags.

SEARCH_TAGS : string

 

Flag for searching using query - search the Ticket ID & Mask ID.

SEARCH_TICKET_ID : string

 

Flag for searching using query - search the User (Full Name, Email).

SEARCH_USER : string

 

Flag for searching using query - search the User Group.

SEARCH_USER_GROUP : string

 

Flag for searching using query - search the User Organization.

SEARCH_USER_ORGANIZATION : string