__construct()
__get()
__set()
__toString()
addUserGroup()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAvailableFilterMethods()
getAvailableOrderMethods()
getController()
getDisplayOrder()
getId()
getModule()
getParentDepartment()
getParentDepartmentId()
getRequiredAPIFields()
getTitle()
getType()
getUserGroupIds()
getUserGroups()
getUserVisibilityCustom()
isNew()
isReadOnly()
isVisibleToUserGroup()
newSubdepartment()
newTicketAuto()
refresh()
save()
setDisplayOrder()
setModule()
setParentDepartment()
setParentDepartmentId()
setReadOnly()
setTitle()
setType()
setUserGroupIds()
setUserVisibilityCustom()
toString()
update()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$controller
$display_order
$id
$module
$object_xml_name
$parent_department_id
$read_only
$title
$type
$user_group_ids
$user_visibility_custom
$_api_fields
$parent_department
$user_groups
FILES_DATA_NAME
MODULE_LIVECHAT
MODULE_TICKETS
TYPE_PRIVATE
TYPE_PUBLIC
Kayako Department 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+-+Department |
since | Kayako version 4.01.204 |
package | Object |
__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
addUserGroup(\kyUserGroup $user_group, bool $clear) : \kyDepartment
Automatically sets custom user visibility flag to True.
bool
Clear the list before adding.
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 $title, string $type, string $module) : \kyDepartment
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
string
Title of new department.
string
Type of new department - one of kyDepartment::TYPE_* constants.
string
Module of new department - one of kyDepartment::MODULE_* constants.
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
getDisplayOrder() : int
filterBy | |
---|---|
orderBy |
int
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
getModule() : string
see | \global\kyDepartment::MODULE |
---|---|
filterBy | |
orderBy |
string
getParentDepartment(bool $reload) : \kyDepartment
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getParentDepartmentId() : int
filterBy | |
---|---|
orderBy |
int
getRequiredAPIFields(bool $create) : string[]
inherited_from | \kyObjectBase::getRequiredAPIFields() |
---|
bool
True when object will be created. False when object will be updated.
string[]
getTitle() : string
filterBy | |
---|---|
orderBy |
string
getType() : string
see | \global\kyDepartment::TYPE |
---|---|
filterBy | |
orderBy |
string
getUserGroupIds() : array
filterBy | name=UserGroupId |
---|
array
getUserGroups(bool $reload) : \kyResultSet
Result is cached until the end of script.
bool
True to reload data from server. False to use the cached value (if present).
getUserVisibilityCustom() : bool
Use getUserGroupIds to get their identifiers or getUserGroups to get the objects.
filterBy |
---|
bool
isNew() : bool
inherited_from | \kyObjectBase::isNew() |
---|
bool
isReadOnly() : bool
inherited_from | \kyObjectBase::isReadOnly() |
---|
bool
isVisibleToUserGroup(\kyUserGroup | int $user_group) : bool
newSubdepartment(string $title, string $type) : \kyDepartment
Module of new department will be the same as parent department's module. WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
string
Title of new department.
string
Type of new department - one of kyDepartment::TYPE_* constants.
newTicketAuto(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.
string
Creator full name.
string
Creator e-mail.
string
Contents of the first post.
string
Subject of new ticket.
setDisplayOrder(int $display_order) : \kyDepartment
int
A positive integer that the helpdesk will use to sort departments when displaying them (ascending).
setModule(string $module) : \kyDepartment
see | \global\kyDepartment::MODULE |
---|
string
Module the department will be associated with.
setParentDepartment(\kyDepartment $parent_department) : \kyDepartment
setParentDepartmentId(int $parent_department_id) : \kyDepartment
int
Identifier of department that will be the parent for this department.
setReadOnly(bool $read_only) : bool
inherited_from | \kyObjectBase::setReadOnly() |
---|
bool
Read only flag.
bool
setUserGroupIds(int[] $user_group_ids) : \kyDepartment
int[]
Identifiers of user groups that can be assigned to this department.
setUserVisibilityCustom(bool $user_visibility_custom) : \kyDepartment
Use setUserGroupIds to set these groups using identifiers or addUserGroup to set them using objects. Automatically clears user groups when set to false.
bool
True to restrict visibility of this department to particular user groups. False otherwise.
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.
$display_order : int
apiField |
---|
$id : int
apiField |
---|
$module : int
apiField | required_create=true |
---|
$object_xml_name : string
Override in descending classes.
$parent_department_id : int
apiField |
---|
$read_only : bool
Override in descending classes.
inherited_from | \kyObjectBase::$$read_only |
---|
$title : string
apiField | required=true |
---|
$type : int
apiField | required_create=true |
---|
$user_group_ids : int[]
apiField | name=usergroups |
---|
$user_visibility_custom : bool
see | \global\kyDepartment::$user_group_ids |
---|---|
apiField |
$_api_fields : array
Format:
array(
'
inherited_from | \kyObjectBase::$$_api_fields |
---|
FILES_DATA_NAME : string
inherited_from | \kyObjectBase::FILES_DATA_NAME |
---|
MODULE_LIVECHAT : string
MODULE_TICKETS : string
TYPE_PRIVATE : string
TYPE_PUBLIC : string