Entry
Entry
An initializer is responsible for creating Entry object.
| Name | Type | Description |
|---|---|---|
| entryUid | string | Uid for the entry instance. |
| contentType | string | ContentType uid for the entry instance. |
language
To set the language code for entry to fetch
| Name | Type | Description |
|---|---|---|
| locale (required) | string | Language code by default is "en-us" |
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->language('en-us')->fetch();includeContentType
To include content_type along with entries.
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->includeContentType()->fetch();includeReferenceContentTypeUID
This method includes the content type UIDs of the referenced entries returned in the response.
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->includeReferenceContentTypeUID()->fetch();includeReference
To include reference(s) of other content type in entries
| Name | Type | Description |
|---|---|---|
| field_uids (required) | array | Array of reference field uids. |
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->includeReference(array('categories')))->fetch();includeEmbeddedItems
To include Embedded Items along with entries and asset.
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->includeEmbeddedItems()->fetch();includeBranch
To include branch of publish content.
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->includeBranch()->fetch();only
To project the fields in the result set
| Name | Type | Description |
|---|---|---|
| level (required) | string | Level for which field uid to include. Set 'BASE' for top level. |
| field_uids (required) | string | field uids as array |
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->toJSON()->only('BASE',array('price'))->fetch();except
To exclude the fields from the result set.
| Name | Type | Description |
|---|---|---|
| level (required) | string | Level for which field uid to except. Set 'BASE' for top level. |
| field_uids (required) | string | field uids as array |
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->toJSON()->except('BASE',array('price'))->fetch();toJSON
To transform the Result object to server response content
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')-toJSON()->fetch();fetch
Fetch the specified entry
use Contentstack\Contentstack;
$stack = Contentstack::Stack('api_key', 'delivery_token', 'environment');
$result = $stack->ContentType('content_type_uid')->Entry('entry_uid')->fetch();