__construct()
__get()
__set()
__toString()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAvailableFilterMethods()
getAvailableOrderMethods()
getController()
getDesignation()
getEmail()
getEnableDST()
getFirstName()
getFullName()
getGreeting()
getId()
getIsEnabled()
getLastName()
getMobileNumber()
getRequiredAPIFields()
getSignature()
getStaffGroup()
getStaffGroupId()
getTimezone()
getUserName()
isNew()
isReadOnly()
newTicket()
refresh()
save()
setDesignation()
setEmail()
setEnableDST()
setFirstName()
setGreeting()
setIsEnabled()
setLastName()
setMobileNumber()
setPassword()
setReadOnly()
setSignature()
setStaffGroup()
setStaffGroupId()
setTimezone()
setUserName()
toString()
update()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$controller
$designation
$enable_dst
$first_name
$full_name
$greeting
$id
$is_enabled
$last_name
$mobile_number
$object_xml_name
$password
$read_only
$signature
$staff_group_id
$timezone
$user_name
$_api_fields
$staff_group
FILES_DATA_NAME
Kayako Staff 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+-+Staff |
since | Kayako version 4.01.204 |
package | Object\Staff |
__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(string $first_name, string $last_name, string $user_name, string $email, \kyStaffGroup $staff_group, string $password) : \kyStaff
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
string
First name of new staff user.
string
Last name of new staff user.
string
Login username of new staff user.
string
E-mail address of new staff user.
string
Password for new staff user.
delete()
inherited_from | \kyObjectBase::delete() |
---|
get(int | array $id) : \kyObjectBase
inherited_from | \kyObjectBase::get() |
---|
int
array
Object identifier or list of identifiers (ex. ticket identifier and ticket post identifier when fetching TicketPost).
getAPIFields() : string[]
Format of returned array:
array( '' => Field description. (getter: , setter: ), ...repeat... )
inherited_from | \kyObjectBase::getAPIFields() |
---|
string[]
getAll(array $search_parameters) : \kyResultSet
inherited_from | \kyObjectBase::getAll() |
---|
array
Optional. Additional search parameters.
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
getController() : string
inherited_from | \kyObjectBase::getController() |
---|
string
getDesignation() : string
filterBy | |
---|---|
orderBy |
string
getEmail() : string
filterBy | |
---|---|
orderBy |
string
getEnableDST() : bool
filterBy |
---|
bool
getFirstName() : string
filterBy | |
---|---|
orderBy |
string
getFullName() : string
filterBy | |
---|---|
orderBy |
string
getGreeting() : string
filterBy |
---|
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
getIsEnabled() : bool
filterBy | |
---|---|
orderBy |
bool
getLastName() : string
filterBy | |
---|---|
orderBy |
string
getMobileNumber() : string
filterBy |
---|
string
getRequiredAPIFields(bool $create) : string[]
inherited_from | \kyObjectBase::getRequiredAPIFields() |
---|
bool
True when object will be created. False when object will be updated.
string[]
getSignature() : string
The value is not available when the object was fetched from the server.
string
getStaffGroup(bool $reload) : \kyStaffGroup
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getStaffGroupId() : int
filterBy | |
---|---|
orderBy |
int
getTimezone() : string
string
getUserName() : string
filterBy | |
---|---|
orderBy |
string
isNew() : bool
inherited_from | \kyObjectBase::isNew() |
---|
bool
isReadOnly() : bool
inherited_from | \kyObjectBase::isReadOnly() |
---|
bool
newTicket(\kyDepartment $department, string $contents, string $subject) : \kyTicket
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
string
Contents of the first post.
string
Subject of the ticket.
setEnableDST(bool $enable_dst) : \kyStaff
True is the default value when creating new staff user.
bool
True to enable Daylight Saving Time for the staff user. False to disable.
setGreeting(string $greeting) : \kyStaff
string
Default greeting message when the staff user accepts a live chat request.
setIsEnabled(bool $is_enabled) : \kyStaff
True is the default value when creating new staff user.
bool
True to enable the staff user. False to disable.
setReadOnly(bool $read_only) : bool
inherited_from | \kyObjectBase::setReadOnly() |
---|
bool
Read only flag.
bool
setSignature(string $signature) : \kyStaff
string
Signature that will be appended to each reply made by the staff user.
toString() : string
string
update() : \kyObjectBase
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 |
---|
$controller : string
Override in descending classes.
$designation : string
apiField |
---|
$email : string
apiField | required_create=true |
---|
$enable_dst : bool
apiField |
---|
$first_name : string
apiField | required=true |
---|
$full_name : string
apiField |
---|
$greeting : string
apiField |
---|
$id : int
apiField |
---|
$is_enabled : bool
apiField |
---|
$last_name : string
apiField | required=true |
---|
$mobile_number : string
apiField |
---|
$object_xml_name : string
Override in descending classes.
$password : string
apiField | required_create=true |
---|
$read_only : bool
Override in descending classes.
inherited_from | \kyObjectBase::$$read_only |
---|
$signature : string
apiField |
---|
$staff_group_id : int
apiField | required_create=true |
---|
$timezone : string
apiField |
---|
$user_name : string
apiField | required_create=true |
---|
$_api_fields : array
Format:
array(
'
inherited_from | \kyObjectBase::$$_api_fields |
---|
FILES_DATA_NAME : string
inherited_from | \kyObjectBase::FILES_DATA_NAME |
---|