__construct()
__get()
__set()
__toString()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAvailableFilterMethods()
getAvailableOrderMethods()
getBillDate()
getContents()
getController()
getCreatorStaff()
getCreatorStaffId()
getCreatorStaffName()
getId()
getNoteColor()
getRequiredAPIFields()
getTicket()
getTicketId()
getTimeBillable()
getTimeWorked()
getWorkDate()
getWorkerStaff()
getWorkerStaffId()
getWorkerStaffName()
isNew()
isReadOnly()
refresh()
save()
setBillDate()
setBillingData()
setContents()
setCreatorStaff()
setCreatorStaffId()
setNoteColor()
setReadOnly()
setTicket()
setTicketId()
setTimeBillable()
setTimeWorked()
setWorkDate()
setWorkedData()
setWorkerStaff()
setWorkerStaffId()
toString()
update()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$bill_date
$contents
$controller
$creator_staff_id
$creator_staff_name
$id
$note_color
$object_xml_name
$read_only
$ticket_id
$time_billable
$time_worked
$work_date
$worker_staff_id
$worker_staff_name
$_api_fields
$creator_staff
$ticket
$worker_staff
COLOR_BLUE
COLOR_GREEN
COLOR_PURPLE
COLOR_RED
COLOR_YELLOW
FILES_DATA_NAME
Kayako TicketTimeTrack 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+-+TicketTimeTrack |
since | Kayako version 4.01.240 |
package | Object\Ticket |
__construct(array $data)
inherited_from | \kyObjectBase::__construct() |
---|
array
Object 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() |
string
API 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() |
string
API field name.
mixed
API field value.
mixed
__toString() : string
Calls toString() method to get the object description.
inherited_from | \kyObjectBase::__toString() |
---|
string
buildData(bool $create) : array
Values must be set in format accepted by REST API.
bool
Indicates if the result will be used to create (true) or update (false) an object.
array
checkRequiredAPIFields(bool $create, bool $throw_exception) : string[] | bool
inherited_from | \kyObjectBase::checkRequiredAPIFields() |
---|
bool
True when object will be created. False when object will be updated.
bool
True 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[]
bool
List of missing API fields or true when there are none.create() : \kyObjectBase
createNew(\kyTicket $ticket, 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.
string
Note contents.
string
Worked time formatted as hh:mm. Work date will be set to current datetime.
string
Billable time formatted as hh:mm. Bill date will be set to current datetime.
delete()
inherited_from | \kyObjectBase::delete() |
---|
get(int $ticket_id, int $id) : \kyTicketTimeTrack
int
Ticket identifier.
int
Ticket time track identifier.
getAPIFields() : string[]
Format of returned array:
array( '' => Field description. (getter: , setter: ), ...repeat... )
inherited_from | \kyObjectBase::getAPIFields() |
---|
string[]
getAvailableFilterMethods(bool $filter_names_only) : array
Optionaly you can return get method names used to filter objects.
inherited_from | \kyObjectBase::getAvailableFilterMethods() |
---|
bool
True (default) to return array('filterByXXX', 'filterByYYY', ...). False to return array('filterByXXX' => 'getXXX', 'filterByYYY' => 'YYY', ...).
array
getAvailableOrderMethods(bool $order_names_only) : array
Optionaly you can return get method names used to order objects.
inherited_from | \kyObjectBase::getAvailableOrderMethods() |
---|
bool
True (default) to return array('orderByXXX', 'orderByYYY', ...). False to return array('orderByXXX' => 'getXXX', 'orderByYYY' => 'YYY', ...).
array
getBillDate(string $format) : string
see | \global\http://www.php.net/manual/en/function.date.php |
---|---|
filterBy | |
orderBy |
string
Output format of the date. If null the format set in client configuration is used.
string
getContents() : string
filterBy |
---|
string
getController() : string
inherited_from | \kyObjectBase::getController() |
---|
string
getCreatorStaff(bool $reload) : \kyStaff
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getCreatorStaffId() : int
filterBy | |
---|---|
orderBy |
int
getCreatorStaffName() : string
filterBy | |
---|---|
orderBy |
string
getId(bool $complete) : int | array
ticket identifier and ticket post identifier in case of TicketPost).
bool
True to return complete list of identifiers as needed by API to identify the object.
int
array
getNoteColor() : int
see | \global\kyTicketTimeTrack::COLOR |
---|
int
getRequiredAPIFields(bool $create) : string[]
inherited_from | \kyObjectBase::getRequiredAPIFields() |
---|
bool
True when object will be created. False when object will be updated.
string[]
getTicket(bool $reload) : \kyTicket
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getTicketId() : int
int
getTimeBillable(bool $formatted) : int | string
filterBy | |
---|---|
orderBy |
bool
True to format result nicely (ex. 02:30:00). False to return amount of seconds.
int
string
getTimeWorked(bool $formatted) : int | string
filterBy | |
---|---|
orderBy |
bool
True to format result nicely (ex. 02:30:00). False to return amount of seconds.
int
string
getWorkDate(string $format) : string
see | \global\http://www.php.net/manual/en/function.date.php |
---|---|
filterBy | |
orderBy |
string
Output format of the date. If null the format set in client configuration is used.
string
getWorkerStaff(bool $reload) : \kyStaff
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getWorkerStaffId() : int
filterBy | |
---|---|
orderBy |
int
getWorkerStaffName() : string
filterBy | |
---|---|
orderBy |
string
isNew() : bool
inherited_from | \kyObjectBase::isNew() |
---|
bool
isReadOnly() : bool
inherited_from | \kyObjectBase::isReadOnly() |
---|
bool
setBillDate(string | int $bill_date) : \kyTicketTimeTrack
see | \global\http://www.php.net/manual/en/function.strtotime.php |
---|
string
int
Date and time when the work was executed (timestamp or string format understood by PHP strtotime).
setBillingData(string | int $time_billable, string $bill_date)
see | \global\http://www.php.net/manual/en/function.strtotime.php |
---|
string
int
Billable time (as seconds or formatted as hh:mm).
string
Date and time when to bill the worker (timestamp or string format understood by PHP strtotime). Defaults to current datetime.
setCreatorStaff(\kyStaff $creator_staff) : \kyTicketTimeTrack
setCreatorStaffId(int $creator_staff_id) : \kyTicketTimeTrack
int
Identifier of staff user that creates the time track.
setNoteColor(int $note_color) : \kyTicketTimeTrack
see | \global\kyTicketTimeTrack::COLOR |
---|
int
Color of the time track - one of kyTicketTimeTrack::COLOR_* constants.
setReadOnly(bool $read_only) : bool
inherited_from | \kyObjectBase::setReadOnly() |
---|
bool
Read only flag.
bool
setTicket(\kyTicket $ticket) : \kyTicketTimeTrack
setTimeBillable(string | int $time_billable) : \kyTicketTimeTrack
string
int
Billable time (as seconds or formatted as hh:mm).
setTimeWorked(string | int $time_worked) : \kyTicketTimeTrack
string
int
Worked time (as seconds or formatted as hh:mm).
setWorkDate(string | int $work_date) : \kyTicketTimeTrack
see | \global\http://www.php.net/manual/en/function.strtotime.php |
---|
string
int
Date and time when the work was executed (timestamp or string format understood by PHP strtotime).
setWorkedData(string | int $time_worked, string $work_date)
see | \global\http://www.php.net/manual/en/function.strtotime.php |
---|
string
int
Worked time (as seconds or formatted as hh:mm).
string
Date and time when the work was exectued (timestamp or string format understood by PHP strtotime). Defaults to current datetime.
setWorkerStaffId(int $worker_staff_id) : \kyTicketTimeTrack
int
Identifier of staff user that has done the work.
toString() : string
string
parseData(array $data)
array
Object data from XML response.
initAPIFieldsAccessors()
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() |
$_filter_methods : string[]
Format:
array(
'
inherited_from | \kyObjectBase::$$_filter_methods |
---|
$_order_methods : string[]
Format:
array(
'
inherited_from | \kyObjectBase::$$_order_methods |
---|
$bill_date : int
apiField | required_create=true alias=billtimeline |
---|
$contents : int
apiField | required_create=true |
---|
$controller : string
Override in descending classes.
$creator_staff_id : int
apiField | required_create=true alias=staffid |
---|
$creator_staff_name : string
apiField |
---|
$id : int
apiField |
---|
$note_color : int
see | \global\kyTicketTimeTrack::COLOR |
---|---|
apiField |
$object_xml_name : string
Override in descending classes.
$read_only : bool
Override in descending classes.
inherited_from | \kyObjectBase::$$read_only |
---|
$ticket_id : int
apiField | required_create=true |
---|
$time_billable : int
apiField | required_create=true |
---|
$time_worked : int
apiField | required_create=true alias=timespent |
---|
$work_date : int
apiField | required_create=true alias=worktimeline |
---|
$worker_staff_id : int
apiField |
---|
$worker_staff_name : string
apiField |
---|
$_api_fields : array
Format:
array(
'
inherited_from | \kyObjectBase::$$_api_fields |
---|
COLOR_BLUE : int
COLOR_GREEN : int
COLOR_PURPLE : int
COLOR_RED : int
COLOR_YELLOW : int
FILES_DATA_NAME : string
inherited_from | \kyObjectBase::FILES_DATA_NAME |
---|