-
Notifications
You must be signed in to change notification settings - Fork 17
ContentItemModel
namespace WatsonSDK\Services\PersonalityInsights;
The class of parameters to be sent to ContentItem of PersonalityInsightsModel.
class ContentItemModel extends ServiceModel
Used to initialize a ContentItemModel model from the parameters.
/**
* ContentItemModel constructor
*
* @param $content string
* @param $id string
* @param $created integer
* @param $updated integer
* @param $contenttype string
* @param $language string
* @param $parentid string
* @param $reply boolean
* @param $forward boolean
*/
public function __construct($content, $id = NULL, $created = NULL, $updated = NULL, $content_type = NULL, $language = NULL, $parent_id = NULL, $reply = NULL, $forward = NULL);
Parameter | Type | Description |
---|---|---|
content | string | A maximum of 20 MB of content (combined across all ContentItem objects) to be analyzed. |
id | string | A unique identifier for this content item. |
created | integer | A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data. |
updated | integer | A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data. |
contenttype | string | The MIME type of the content: text/plain for plain text (the defaul) text/html for HTML content The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted. |
language | string | The language of the content as a two-letter ISO 639-1 identifier: ar (Arabic) en (English, the default) es (Spanish) ja (Japanese) Regional variants are treated as their parent language; for example, en-US is interpreted as en. A language specified with the Content-Language header of the request overrides the value of this parameter; content items that specify a different language are ignored. Omit the Content-Language header to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input text and the response. |
parentid | string | The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on. |
reply | boolean | Indicates whether this content item is a reply to another content item. |
forward | boolean | Indicates whether this content item is a forwarded/copied version of another content item. |
ContentItemModel Language CONSTS.
const LANGUAGE_AR = 'ar';
const LANGUAGE_EN = 'en';
const LANGUAGE_SP = 'es';
const LANGUAGE_JA = 'ja';
ContentItemModel Content-Type.
const CONTENT_TYPE_PLAIN = 'text/plain';
const CONTENT_TYPE_HTML = 'text/html';
Get content
(combined across all ContentItem objects) to be analyzed.
public function getContent();
Set content
public function setContent($val);
Get the unique identifier
for this content item.
public function getId();
Set the unique identifier
for this content item.
public function setId($id);
Get timestamp
that identifies when this content was created.
public function getCreated();
Set timestamp
that identifies when this content was created.
public function setCreated($created);
Get timestamp
that identifies when this content was last updated.
public function getUpdated();
Set timestamp
that identifies when this content was last updated.
public function setUpdated($updated);
Get the MIME type
of the content.
public function getContentType();
Set the MIME type
of the content.
public function setContentType($content_type);
Set language
of the input text for the request
public function setContentLanguage($val);
Get the language of the content.
public function getLanguage();
Set the language of the content as a two-letter ISO 639-1 identifier.
public function setLanguage($language);
Get the unique ID
of the parent content item for this item.
public function getParentId();
Set the unique ID
of the parent content item for this item.
public function setParentId($parentid);
Get reply relationship
to another content item.
public function getReply();
Set reply relationship
to another content item.
public function setReply($reply);
Get indicator
if this content item is a forwarded/copied version of another content item.
public function getForward();
Set indicator
if this content item is a forwarded/copied version of another content item.
public function setForward($forward);
Copyright 2017 GCG GBS CTO Office under the Apache 2.0 license.