__construct()
__get()
__set()
__toString()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAttachments()
getAvailableFilterMethods()
getAvailableOrderMethods()
getContents()
getController()
getCreator()
getCreatorType()
getDateline()
getEmail()
getEmailTo()
getFullName()
getHasAttachments()
getIPAddress()
getId()
getIsEmailed()
getIsHTML()
getIsPrivate()
getIsSurveyComment()
getIsThirdParty()
getRequiredAPIFields()
getStaff()
getStaffId()
getSubject()
getTicket()
getTicketId()
getUser()
getUserId()
isNew()
isReadOnly()
newAttachment()
newAttachmentFromFile()
refresh()
save()
setContents()
setCreator()
setIsPrivate()
setReadOnly()
setStaff()
setStaffId()
setSubject()
setTicket()
setTicketId()
setUser()
setUserId()
toString()
update()
buildDataBool()
buildDataList()
buildDataNumeric()
buildDataString()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$contents
$controller
$creator
$dateline
$email_to
$full_name
$has_attachments
$id
$ip_address
$is_emailed
$is_html
$is_private
$is_survey_comment
$is_third_party
$object_xml_name
$read_only
$staff_id
$subject
$ticket_id
$user_id
$_api_fields
$attachments
$staff
$ticket
$user
CREATOR_BCC
CREATOR_CC
CREATOR_CLIENT
CREATOR_STAFF
CREATOR_THIRDPARTY
CREATOR_USER
FILES_DATA_NAME
Kayako TicketPost 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+-+TicketPost |
| since | Kayako version 4.50.1636 |
| package | Object\Ticket |
__construct(array $data)
| inherited_from | \kyObjectBase::__construct() |
|---|
arrayObject data from XML response converted into array.
__get(string $api_field_name) : mixed
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() |
stringAPI field name.
mixed__set(string $api_field_name, mixed $value) : mixed
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() |
stringAPI field name.
mixedAPI field value.
mixed__toString() : string
Calls toString() method to get the object description.
| inherited_from | \kyObjectBase::__toString() |
|---|
stringbuildData(bool $create) : array
Values must be set in format accepted by REST API.
boolIndicates if the result will be used to create (true) or update (false) an object.
arraycheckRequiredAPIFields(bool $create, bool $throw_exception) : string[] | bool
| inherited_from | \kyObjectBase::checkRequiredAPIFields() |
|---|
boolTrue when object will be created. False when object will be updated.
boolTrue to throw an exception on missing fields. False to return list of missing fields or true when there are none.
\kyException |
When there are missing field values and $throw_exception is true. |
|---|
string[]boolList of missing API fields or true when there are none.create() : \kyObjectBase
createNew(\kyTicket $ticket, \kyUser | \kyStaff $creator, string $contents) : \kyTicketPost
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringContents of new post.
delete()
getAPIFields() : string[]
Format of returned array:
array(
'' => Field description. (getter: , setter: ),
...repeat...
)
| inherited_from | \kyObjectBase::getAPIFields() |
|---|
string[]getAttachments(bool $reload) : \kyResultSet
Result is cached.
boolTrue to reload attachments from server.
getAvailableFilterMethods(bool $filter_names_only) : array
Optionaly you can return get method names used to filter objects.
| inherited_from | \kyObjectBase::getAvailableFilterMethods() |
|---|
boolTrue (default) to return array('filterByXXX', 'filterByYYY', ...). False to return array('filterByXXX' => 'getXXX', 'filterByYYY' => 'YYY', ...).
arraygetAvailableOrderMethods(bool $order_names_only) : array
Optionaly you can return get method names used to order objects.
| inherited_from | \kyObjectBase::getAvailableOrderMethods() |
|---|
boolTrue (default) to return array('orderByXXX', 'orderByYYY', ...). False to return array('orderByXXX' => 'getXXX', 'orderByYYY' => 'YYY', ...).
arraygetContents() : string
| filterBy | |
|---|---|
| orderBy |
stringgetController() : string
| inherited_from | \kyObjectBase::getController() |
|---|
stringgetCreatorType() : int
| see | \global\kyTicketPost::CREATOR |
|---|---|
| filterBy | |
| orderBy |
intgetDateline(string $format) : string
| see | \global\http://www.php.net/manual/en/function.date.php |
|---|---|
| filterBy | |
| orderBy |
stringOutput format of the date. If null the format set in client configuration is used.
stringgetEmail() : string
| filterBy | |
|---|---|
| orderBy |
stringgetEmailTo() : string
Applicable when the 'send email' option is used by the a staff user when creating the ticket post.
| filterBy | |
|---|---|
| orderBy |
stringgetFullName() : string
| filterBy | |
|---|---|
| orderBy |
stringgetHasAttachments() : bool
| filterBy | |
|---|---|
| orderBy |
boolgetIPAddress() : string
| filterBy | |
|---|---|
| orderBy |
stringgetId(bool $complete) : int | array
ticket identifier and ticket post identifier in case of TicketPost).
boolTrue to return complete list of identifiers as needed by API to identify the object.
intarray
getIsEmailed() : bool
| filterBy |
|---|
boolgetIsHTML() : bool
| filterBy |
|---|
boolgetIsPrivate() : bool
| filterBy | |
|---|---|
| orderBy |
boolgetIsSurveyComment() : bool
| filterBy |
|---|
boolgetIsThirdParty() : bool
| filterBy |
|---|
boolgetRequiredAPIFields(bool $create) : string[]
| inherited_from | \kyObjectBase::getRequiredAPIFields() |
|---|
boolTrue when object will be created. False when object will be updated.
string[]getStaff(bool $reload) : \kyStaff
boolTrue to reload data from server. False to use the cached value (if present).
getStaffId() : int
| filterBy | |
|---|---|
| orderBy |
intgetSubject() : string
| filterBy |
|---|
stringgetTicket(bool $reload) : \kyTicket
Result is cached until the end of script.
boolTrue to reload data from server. False to use the cached value (if present).
getTicketId() : int
intgetUser(bool $reload) : \kyUser
boolTrue to reload data from server. False to use the cached value (if present).
getUserId() : int
| filterBy | |
|---|---|
| orderBy |
intisNew() : bool
| inherited_from | \kyObjectBase::isNew() |
|---|
boolisReadOnly() : bool
| inherited_from | \kyObjectBase::isReadOnly() |
|---|
boolnewAttachment(string $contents, string $file_name) : \kyTicketAttachment
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringRaw contents of the file.
stringFilename.
newAttachmentFromFile(string $file_path, string $file_name) : \kyTicketAttachment
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringPath to file.
stringOptional. Use to set filename other than physical file.
setCreator(int | \kyUser | \kyStaff $creator, int $type) : \kyTicketPost
| see | \global\kyTicketPost::CREATOR |
|---|
intCreator type. Required only when $creator is an identifier.
setIsPrivate(bool $is_private) : \kyTicketPost
boolWhether the ticket post should be created as private (hidden from the customer) or not.
setReadOnly(bool $read_only) : bool
| inherited_from | \kyObjectBase::setReadOnly() |
|---|
boolRead only flag.
booltoString() : string
stringbuildDataBool(array $data, string $field_name, mixed $field_value)
| inherited_from | \kyObjectBase::buildDataBool() |
|---|
arrayData used to create or update the object.
stringField name.
mixedField value.
buildDataList(array $data, string $field_name, mixed $field_value)
| inherited_from | \kyObjectBase::buildDataList() |
|---|
arrayData used to create or update the object.
stringField name.
mixedField value.
buildDataNumeric(array $data, string $field_name, mixed $field_value)
| inherited_from | \kyObjectBase::buildDataNumeric() |
|---|
arrayData used to create or update the object.
stringField name.
mixedField value.
buildDataString(array $data, string $field_name, mixed $field_value)
| inherited_from | \kyObjectBase::buildDataString() |
|---|
arrayData used to create or update the object.
stringField name.
mixedField value.
parseData(array $data)
arrayObject data from XML response.
initAPIFieldsAccessors()
Scans protected and private properties of called class, searches for
| apiField | [name=field name]{0,1} [alias=field name alias]* [accessor=setter/getter name]{0,1} [getter=getter name]{0,1} [setter=setter name]{0,1} [required_create=true if field if required when creating object]{0,1} [required_update=true if field if required when udpating object]{0,1} [required=true if field if required when creating or updating object]{0,1} 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() |
$_filter_methods : string[]
Format:
array(
'
| inherited_from | \kyObjectBase::$$_filter_methods |
|---|
$_order_methods : string[]
Format:
array(
'
| inherited_from | \kyObjectBase::$$_order_methods |
|---|
$contents : string
| apiField | required_create=true |
|---|
$controller : string
Override in descending classes.
$creator : int
| see | \global\kyTicketPost::CREATOR |
|---|---|
| apiField | getter=getCreatorType |
$dateline : int
| apiField |
|---|
$email : string
| apiField |
|---|
$email_to : string
Applicable when the 'send email' option is used by the a staff user when creating the ticket post.
| apiField |
|---|
$full_name : int
| apiField |
|---|
$id : int
| apiField |
|---|
$ip_address : string
| apiField |
|---|
$is_emailed : bool
| apiField |
|---|
$is_html : bool
| apiField |
|---|
$is_private : bool
| apiField |
|---|
$is_third_party : bool
| apiField |
|---|
$object_xml_name : string
Override in descending classes.
$read_only : bool
Override in descending classes.
| inherited_from | \kyObjectBase::$$read_only |
|---|
$staff_id : int
Applicable if the post was created by staff user.
| apiField |
|---|
$subject : string
If the ticket post was created through an e-mail queue this is subject of the email message that resulted in the creation of the post.
| apiField |
|---|
$ticket_id : int
| apiField | required_create=true |
|---|
$user_id : int
Applicable if the post was created by a known user through an email queue or through the web interface.
| apiField |
|---|
$_api_fields : array
Format:
array(
'
| inherited_from | \kyObjectBase::$$_api_fields |
|---|
$staff : \kyStaff
Applicable if the post was created by staff user.
CREATOR_BCC : int
CREATOR_CC : int
CREATOR_CLIENT : int
CREATOR_STAFF : int
CREATOR_THIRDPARTY : int
CREATOR_USER : int
FILES_DATA_NAME : string
| inherited_from | \kyObjectBase::FILES_DATA_NAME |
|---|
Whether this post is a survey comment.