IsExpired()
__construct()
__get()
__set()
__toString()
addCategory()
addStaffGroup()
addUserGroup()
buildData()
checkRequiredAPIFields()
create()
createNew()
delete()
get()
getAPIFields()
getAll()
getAllowComments()
getAuthor()
getAuthorEmail()
getAvailableFilterMethods()
getAvailableOrderMethods()
getCategories()
getCategoryIds()
getContents()
getController()
getDateline()
getEmailSubject()
getExpiry()
getId()
getIsSynced()
getRequiredAPIFields()
getStaff()
getStaffGroupIds()
getStaffGroups()
getStaffId()
getStaffVisibilityCustom()
getStatus()
getSubject()
getTotalComments()
getType()
getUserGroupIds()
getUserGroups()
getUserVisibilityCustom()
isInCategory()
isNew()
isReadOnly()
isVisibleToStaffGroup()
isVisibleToUserGroup()
refresh()
save()
setAllowComments()
setCategoryIds()
setContents()
setEditedStaff()
setEditedStaffId()
setEmail()
setEmailSubject()
setExpiry()
setFromName()
setReadOnly()
setSendEmail()
setStaff()
setStaffGroupIds()
setStaffId()
setStaffVisibilityCustom()
setStatus()
setSubject()
setType()
setUserGroupIds()
setUserVisibilityCustom()
toString()
update()
buildDataBool()
buildDataList()
buildDataNumeric()
buildDataString()
getRESTClient()
parseData()
initAPIFieldsAccessors()
$_filter_methods
$_order_methods
$allow_comments
$author
$author_email
$category_ids
$contents
$controller
$dateline
$edited_staff_id
$email_subject
$expiry
$from_name
$id
$is_synced
$object_xml_name
$read_only
$send_email
$staff_group_ids
$staff_id
$staff_visibility_custom
$status
$subject
$total_comments
$type
$user_group_ids
$user_visibility_custom
$_api_fields
$categories
$edited_staff
$staff
$staff_groups
$user_groups
FILES_DATA_NAME
STATUS_DRAFT
STATUS_PUBLISHED
TYPE_GLOBAL
TYPE_PRIVATE
TYPE_PUBLIC
Kayako NewsItem object.
Known issues: - could not create NewsItem with PUBLIC and PRIVATE type (http://dev.kayako.com/browse/SWIFT-3108) - fields customemailsubject and fromname are ignored (http://dev.kayako.com/browse/SWIFT-3111)
| author | Tomasz Sawicki (https://github.com/Furgas) |
|---|---|
| link | http://wiki.kayako.com/display/DEV/REST+-+NewsItem |
| since | Kayako version 4.51.1891 |
| package | Object\News |
IsExpired() : bool
| filterBy | name=IsExpired |
|---|---|
| orderBy | name=IsExpired |
bool__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() |
|---|
stringaddCategory(\kyNewsCategory $category, bool $clear) : \kyNewsItem
boolClear the list before adding.
addStaffGroup(\kyStaffGroup $staff_group, bool $clear) : \kyNewsItem
Automatically sets custom staff visibility flag to True.
boolClear the list before adding.
addUserGroup(\kyUserGroup $user_group, bool $clear) : \kyNewsItem
Automatically sets custom user visibility flag to True.
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 $subject, string $contents, \kyStaff $staff) : \kyNewsItem
WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
stringSubject of news item.
stringContents of news item.
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[]getAllowComments() : bool
| filterBy | |
|---|---|
| orderBy |
boolgetAuthor() : string
| filterBy | |
|---|---|
| orderBy |
stringgetAuthorEmail() : string
| filterBy | |
|---|---|
| orderBy |
stringgetAvailableFilterMethods(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', ...).
arraygetCategories(bool $reload) : \kyResultSet
Result is cached until the end of script.
boolTrue to reload data from server. False to use the cached value (if present).
getCategoryIds() : array
| filterBy | name=CategoryId |
|---|
arraygetContents() : string
| filterBy |
|---|
stringgetController() : 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.
stringgetEmailSubject() : string
| filterBy | |
|---|---|
| orderBy |
stringgetExpiry(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.
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
getIsSynced() : bool
| filterBy | |
|---|---|
| orderBy |
boolgetRequiredAPIFields(bool $create) : string[]
| inherited_from | \kyObjectBase::getRequiredAPIFields() |
|---|
boolTrue when object will be created. False when object will be updated.
string[]getStaff(bool $reload) : \kyStaff
boolTrue to reload data from server. False to use the cached value (if present).
getStaffGroupIds() : array
| filterBy | name=StaffGroupId |
|---|
arraygetStaffGroups(bool $reload) : \kyResultSet
Result is cached until the end of script.
boolTrue to reload data from server. False to use the cached value (if present).
getStaffId() : int
| filterBy | |
|---|---|
| orderBy |
intgetStaffVisibilityCustom() : bool
Use getStaffGroupIds to get their identifiers or getStaffGroups to get the objects.
| filterBy |
|---|
boolgetStatus() : int
| see | \global\kyNewsItem::STATUS |
|---|---|
| filterBy | |
| orderBy |
intgetSubject() : string
| filterBy | |
|---|---|
| orderBy |
stringgetTotalComments() : int
| filterBy | |
|---|---|
| orderBy |
intgetType() : int
| see | \global\kyNewsItem::TYPE |
|---|---|
| filterBy | |
| orderBy |
intgetUserGroupIds() : array
| filterBy | name=UserGroupId |
|---|
arraygetUserGroups(bool $reload) : \kyResultSet
Result is cached until the end of script.
boolTrue 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 |
|---|
boolisInCategory(\kyNewsCategory | int $category) : bool
isNew() : bool
| inherited_from | \kyObjectBase::isNew() |
|---|
boolisReadOnly() : bool
| inherited_from | \kyObjectBase::isReadOnly() |
|---|
boolisVisibleToStaffGroup(\kyStaffGroup | int $staff_group, bool $check_expiration) : bool
| filterBy |
|---|
boolWhether to also check if news item is expired.
boolisVisibleToUserGroup(\kyUserGroup | int $user_group, bool $check_expiration) : bool
| filterBy |
|---|
boolWhether to also check if news item is expired.
boolsetAllowComments(bool $allow_comments) : \kyNewsItem
boolTrue to allow clients to comment on this news item.
setCategoryIds(int[] $category_ids) : \kyNewsItem
setEditedStaffId(int $staff_id) : \kyNewsItem
setEmail(string $email) : \kyNewsItem
stringThe From Email address that will be used for the emails sent out to subscribers. Please note that this may be the address users reply back to (if they reply to the news article email).
setEmailSubject(string $email_subject) : \kyNewsItem
| see | \global\http://dev.kayako.com/browse/SWIFT-3111 |
|---|
stringSubject for the mass email that will be send out to the subscribers for this news article. If no subject is specified, the subject of the news article will be used instead.
setExpiry(string | int | null $expiry) : \kyNewsItem
| see | \global\http://www.php.net/manual/en/function.strtotime.php |
|---|
stringintnullDate and time when the news item will expire (timestamp or string format understood by PHP strtotime). Null to disable expiration.
setFromName(string $from_name) : \kyNewsItem
| see | \global\http://dev.kayako.com/browse/SWIFT-3111 |
|---|
stringThe From Name email header that will be used for the emails sent out to subscribers.
setReadOnly(bool $read_only) : bool
| inherited_from | \kyObjectBase::setReadOnly() |
|---|
boolRead only flag.
boolsetSendEmail(bool $send_email) : \kyNewsItem
boolTrue to send notification email to subscribers when creating or updating this news item. False otherwise.
setStaffGroupIds(int[] $staff_group_ids) : \kyNewsItem
int[]Identifiers of staff groups that this news item will be visible to.
setStaffId(int $staff_id) : \kyNewsItem
setStaffVisibilityCustom(bool $staff_visibility_custom) : \kyNewsItem
Use setStaffGroupIds to set these groups using identifiers or addStaffGroup to set them using objects. Automatically clears staff groups when set to false.
boolTrue to restrict visibility of this news item to particular staff groups. False otherwise.
setType(int $type) : \kyNewsItem
| see | \global\kyNewsItem::TYPE |
|---|---|
| see | \global\http://dev.kayako.com/browse/SWIFT-3108 |
intType of the news item.
setUserGroupIds(int[] $user_group_ids) : \kyNewsItem
int[]Identifiers of user groups that this news item will be visible to.
setUserVisibilityCustom(bool $user_visibility_custom) : \kyNewsItem
Use setUserGroupIds to set these groups using identifiers or addUserGroup to set them using objects. Automatically clears user groups when set to false.
boolTrue to restrict visibility of this news item to particular user groups. False otherwise.
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 |
|---|
$category_ids : int[]
| apiField | name=categories |
|---|
$contents : string
| apiField | required=true |
|---|
$controller : string
Override in descending classes.
$dateline : int
| apiField |
|---|
$edited_staff_id : int
| apiField | required_update=true |
|---|
$email : string
| apiField |
|---|
$email_subject : string
| apiField | alias=customemailsubject |
|---|
$expiry : int
| apiField |
|---|
$from_name : string
$id : int
| apiField |
|---|
$is_synced : bool
| apiField |
|---|
$object_xml_name : string
Override in descending classes.
$read_only : bool
Override in descending classes.
| inherited_from | \kyObjectBase::$$read_only |
|---|
$send_email : bool
| apiField |
|---|
$staff_group_ids : int[]
| apiField | name=staffgroupidlist |
|---|
$staff_id : int
| apiField | required_create=true |
|---|
$staff_visibility_custom : bool
| see | \global\kyNewsItem::$staff_group_ids |
|---|---|
| apiField |
$status : int
| apiField | name=newsstatus |
|---|
$subject : string
| apiField |
|---|
$total_comments : int
| apiField |
|---|
$type : int
| apiField | name=newstype |
|---|
$user_group_ids : int[]
| apiField | name=usergroupidlist |
|---|
$user_visibility_custom : bool
| see | \global\kyNewsItem::$user_group_ids |
|---|---|
| apiField |
$_api_fields : array
Format:
array(
'
| inherited_from | \kyObjectBase::$$_api_fields |
|---|
FILES_DATA_NAME : string
| inherited_from | \kyObjectBase::FILES_DATA_NAME |
|---|
STATUS_DRAFT : int
STATUS_PUBLISHED : int
TYPE_GLOBAL : int
The news articles classified as Global are visible in both the client support center and the staff control panel.
TYPE_PRIVATE : int
The news article classified as Private are only visible in the staff control panel.
TYPE_PUBLIC : int
The news articles classified as Public are visible only in the client support center.
Whether to allow comments.