__construct()
__get()
__set()
__toString()
buildData()
checkRequiredAPIFields()
create()
createByType()
createNew()
delete()
get()
getAPIFields()
getAll()
getAvailableFilterMethods()
getAvailableOrderMethods()
getController()
getDefinition()
getId()
getName()
getOption()
getRawValue()
getRequiredAPIFields()
getTitle()
getType()
getValue()
isNew()
isReadOnly()
refresh()
save()
setReadOnly()
setValue()
toString()
update()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$controller
$custom_field_group
$definition
$id
$name
$object_xml_name
$raw_value
$read_only
$title
$type
$_api_fields
FILES_DATA_NAME
Class for custom field with text value and base class for other types of custom fields.
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) |
---|---|
since | Kayako version 4.40.1079 |
package | Object\CustomField |
__construct(\kyCustomFieldGroupBase $custom_field_group, array $data)
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.
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.createByType(\kyCustomFieldGroupBase $custom_field_group, array $data) : \kyCustomField
createNew()
Compatible with method chaining.
inherited_from | \kyObjectBase::createNew() |
---|
delete()
get(int | array $id) : \kyObjectBase
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[]
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
getDefinition(bool $reload) : \kyCustomFieldDefinition
bool
True to reload data from server. False to use the cached value (if present).
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
getName() : string
filterBy | |
---|---|
orderBy |
string
getOption(mixed $value) : \kyCustomFieldOption
Returns null if option was not found.
mixed
Identifier of option OR value of option OR option.
getRawValue() : string
filterBy | |
---|---|
orderBy |
string
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() : int
filterBy | |
---|---|
orderBy |
int
getValue() : string
Method is overloaded in descendant classes and return value interpretation depends on field type.
string
isNew() : bool
inherited_from | \kyObjectBase::isNew() |
---|
bool
isReadOnly() : bool
inherited_from | \kyObjectBase::isReadOnly() |
---|
bool
setReadOnly(bool $read_only) : bool
inherited_from | \kyObjectBase::setReadOnly() |
---|
bool
Read only flag.
bool
setValue(string $value) : \kyCustomField
Method is overloaded in descendant classes and value interpretation depends on field type.
string
Value.
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 |
---|
$controller : string
Override in descending classes.
inherited_from | \kyObjectBase::$$controller |
---|
$id : int
apiField |
---|
$name : string
apiField |
---|
$object_xml_name : string
Override in descending classes.
inherited_from | \kyObjectBase::$$object_xml_name |
---|
$raw_value : string
apiField | name=value getter=getRawValue setter=setValue |
---|
$read_only : bool
Override in descending classes.
inherited_from | \kyObjectBase::$$read_only |
---|
$title : string
apiField |
---|
$type : int
apiField |
---|
$_api_fields : array
Format:
array(
'
inherited_from | \kyObjectBase::$$_api_fields |
---|
FILES_DATA_NAME : string
inherited_from | \kyObjectBase::FILES_DATA_NAME |
---|