__construct()
__get()
__set()
__toString()
addEmail()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAvailableFilterMethods()
getAvailableOrderMethods()
getController()
getDateline()
getDesignation()
getEmail()
getEmails()
getEnableDST()
getFullName()
getId()
getIsEnabled()
getLastVisit()
getPhone()
getRequiredAPIFields()
getSLAPlanExpiry()
getSLAPlanId()
getSalutation()
getTimezone()
getUserExpiry()
getUserGroup()
getUserGroupId()
getUserOrganization()
getUserOrganizationId()
getUserRole()
isNew()
isReadOnly()
newTicket()
refresh()
save()
search()
setDesignation()
setEnableDST()
setFullName()
setIsEnabled()
setPassword()
setPhone()
setReadOnly()
setSLAPlanExpiry()
setSLAPlanId()
setSalutation()
setSendWelcomeEmail()
setTimezone()
setUserExpiry()
setUserGroup()
setUserGroupId()
setUserOrganization()
setUserOrganizationId()
setUserRole()
toString()
update()
buildDataBool()
buildDataList()
buildDataNumeric()
buildDataString()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$controller
$dateline
$designation
$enable_dst
$full_name
$id
$is_enabled
$last_visit
$object_xml_name
$password
$phone
$read_only
$salutation
$send_welcome_email
$sla_plan_expiry
$sla_plan_id
$timezone
$user_expiry
$user_group_id
$user_organization_id
$user_role
$_api_fields
$user_group
$user_organization
FILES_DATA_NAME
ROLE_MANAGER
ROLE_USER
SALUTATION_DR
SALUTATION_MISS
SALUTATION_MR
SALUTATION_MRS
Kayako User 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+-+User |
| since | Kayako version 4.01.204 |
| package | Object\User |
__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() |
|---|
stringaddEmail(string $email, bool $clear)
stringE-mail address.
boolClear the list before adding.
buildData(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(string $full_name, string $email, \kyUserGroup $user_group, string $password) : \kyUser
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringFull name of new user.
stringE-mail address of new user.
stringPassword of new user.
delete()
| inherited_from | \kyObjectBase::delete() |
|---|
get(int | array $id) : \kyObjectBase
| inherited_from | \kyObjectBase::get() |
|---|
intarrayObject 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(int $starting_user_id, int $max_items) : \kyResultSet
Optionaly you can get segment of user objects by defining starting user identifier and maximum items count.
intOptional starting user identifier.
intOptional maximum items count. Defaults to 1000 when starting user is defined.
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', ...).
arraygetController() : string
| inherited_from | \kyObjectBase::getController() |
|---|
stringgetDateline(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.
stringgetDesignation() : string
| filterBy | |
|---|---|
| orderBy |
stringgetEmail() : string
stringgetEmails() : string[]
| filterBy | name=Email |
|---|
string[]getEnableDST() : bool
| filterBy |
|---|
boolgetFullName() : 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
getIsEnabled() : bool
| filterBy |
|---|
boolgetLastVisit(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.
stringgetPhone() : string
| filterBy |
|---|
stringgetRequiredAPIFields(bool $create) : string[]
| inherited_from | \kyObjectBase::getRequiredAPIFields() |
|---|
boolTrue when object will be created. False when object will be updated.
string[]getSLAPlanExpiry(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.
stringgetSLAPlanId() : int
| filterBy |
|---|
intgetSalutation() : string
| see | \global\kyUser::SALUTATION |
|---|---|
| filterBy | |
| orderBy |
stringgetTimezone() : string
| filterBy |
|---|
stringgetUserExpiry(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.
stringgetUserGroup(bool $reload) : \kyUserGroup
Result is cached until the end of script.
boolTrue to reload data from server. False to use the cached value (if present).
getUserGroupId() : int
| filterBy | |
|---|---|
| orderBy |
intgetUserOrganization(bool $reload) : \kyUserOrganization
Result is cached until the end of script.
boolTrue to reload data from server. False to use the cached value (if present).
getUserOrganizationId() : int
| filterBy | |
|---|---|
| orderBy |
intgetUserRole() : string
| see | \global\kyUser:ROLE |
|---|---|
| filterBy | |
| orderBy |
stringisNew() : bool
| inherited_from | \kyObjectBase::isNew() |
|---|
boolisReadOnly() : bool
| inherited_from | \kyObjectBase::isReadOnly() |
|---|
boolnewTicket(\kyDepartment $department, string $contents, string $subject) : \kyTicket
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringContents of the first post.
stringSubject of the ticket.
search(string $query) : \kyResultSet
Performs server-side search of users. The search query is run against email, full name, phone, organization name and user group.
| link | http://wiki.kayako.com/display/DEV/REST+-+UserSearch |
|---|---|
| since | Kayako version 4.40.1148 |
stringThe search query.
setEnableDST(bool $enable_dst) : \kyUser
boolTrue, to enable daylight saving time. False, to disable daylight saving time.
setReadOnly(bool $read_only) : bool
| inherited_from | \kyObjectBase::setReadOnly() |
|---|
boolRead only flag.
boolsetSLAPlanExpiry(string | int | null $sla_plan_expiry) : \kyUser
| see | \global\http://www.php.net/manual/en/function.strtotime.php |
|---|
stringintnullDate and time when Service Level Agreement plan for this user will expire (timestamp or string format understood by PHP strtotime). Null to disable expiration.
setSLAPlanId(int $sla_plan_id) : \kyUser
setSendWelcomeEmail(bool $send_welcome_email) : \kyUser
boolTrue, to send welcome email to new user. False, otherwise.
setTimezone(string $timezone) : \kyUser
See http://php.net/manual/en/timezones.php for list of available timezones.
stringTimezone of the user.
setUserExpiry(string | int | null $user_expiry) : \kyUser
| see | \global\http://www.php.net/manual/en/function.strtotime.php |
|---|
stringintnullDate and time when the user will expire (timestamp or string format understood by PHP strtotime). Null to disable expiration.
setUserOrganization(\kyUserOrganization $user_organization) : \kyUser
setUserOrganizationId(int $user_organization_id) : \kyUser
toString() : string
stringupdate() : \kyObjectBase
buildDataBool(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 |
|---|
$controller : string
Override in descending classes.
$dateline : int
| apiField |
|---|
$designation : string
| apiField |
|---|
$email : string[]
| apiField | required_create=true |
|---|
$enable_dst : bool
| apiField |
|---|
$full_name : string
| apiField | required=true |
|---|
$id : int
| apiField |
|---|
$is_enabled : bool
| apiField |
|---|
$last_visit : int
| apiField |
|---|
$object_xml_name : string
Override in descending classes.
$password : string
| apiField | required_create=true |
|---|
$phone : string
| apiField |
|---|
$read_only : bool
Override in descending classes.
| inherited_from | \kyObjectBase::$$read_only |
|---|
$salutation : string
| see | \global\kyUser::SALUTATION |
|---|---|
| apiField |
$send_welcome_email : bool
| apiField |
|---|
$sla_plan_expiry : int
| apiField |
|---|
$sla_plan_id : int
| apiField |
|---|
$timezone : string
| apiField |
|---|
$user_expiry : int
| apiField |
|---|
$user_group_id : int
| apiField | required_create=true |
|---|
$user_organization_id : int
| apiField |
|---|
$user_role : string
| see | \global\kyUser::ROLE |
|---|---|
| apiField |
$_api_fields : array
Format:
array(
'
| inherited_from | \kyObjectBase::$$_api_fields |
|---|
FILES_DATA_NAME : string
| inherited_from | \kyObjectBase::FILES_DATA_NAME |
|---|
ROLE_MANAGER
ROLE_USER
SALUTATION_DR
SALUTATION_MISS
SALUTATION_MR
SALUTATION_MRS