class Utility

Utility/Helper where all the helper and utility functions will be available.

Methods

static array
validateInput(string $type = '', object $input = array())

Validation for all the parameters required for the SDK

static 
isLivePreview($query)

No description

static string
getDomain(Stack $query)

Get the domain from the current object

static string
contentstackUrl(object $queryObject = '', string $type = '')

Contentstack URL method to create the url based on the request

static array
headers(array $query = '')

Header transformation as it required format

static json
generateQuery(array $query = array())

POST formatted query for the API server

static QueryParameters
generateQueryParams(array $query = array())

Sending the GET requests with all the parameters in POST as well as GET

static ResultWrapped
wrapResult(object $result = '', object $queryObject = '')

Wrap Result

static Result
contentstackRequest($stack, object $queryObject = '', object $type = '', $count = 0)

Contentstack request to the API server based on the data

static 
to_render_content($resp, $entry_uid, $live_response_decode)

No description

static bool
isKeySet(array $input = array(), string $key = '')

Validate the key is set or not

static bool
isEmpty(object $input)

Validate the String

static object
getLastActivites(object $queryObject)

Get Last activities

static object
debug(object $input, bool $exit = false)

DEBUGGING MESSAGE

Details

at line 41
static array validateInput(string $type = '', object $input = array())

Validation for all the parameters required for the SDK

Parameters

string $type
  • type of the value to be validated
object $input
  • value of the respective type

Return Value

array

at line 102
static isLivePreview($query)

No description

Parameters

$query

at line 116
static string getDomain(Stack $query)

Get the domain from the current object

Parameters

Stack $query
  • Instance of S.tack

Return Value

string

at line 146
static string contentstackUrl(object $queryObject = '', string $type = '')

Contentstack URL method to create the url based on the request

Parameters

object $queryObject
  • Query Object
string $type
  • type for url

Return Value

string

at line 191
static array headers(array $query = '')

Header transformation as it required format

Parameters

array $query
  • input headers in key value pair

Return Value

array

at line 215
static json generateQuery(array $query = array())

POST formatted query for the API server

Parameters

array $query
  • Query array

Return Value

json

at line 270
static QueryParameters generateQueryParams(array $query = array())

Sending the GET requests with all the parameters in POST as well as GET

Parameters

array $query
  • Query array

Return Value

QueryParameters

at line 284
static ResultWrapped wrapResult(object $result = '', object $queryObject = '')

Wrap Result

Parameters

object $result
  • Response content
object $queryObject
  • Query object

Return Value

ResultWrapped Object

at line 378
static Result contentstackRequest($stack, object $queryObject = '', object $type = '', $count = 0)

Contentstack request to the API server based on the data

Parameters

$stack
object $queryObject
  • Query Object
object $type
  • type of request
$count

Return Value

Result

at line 484
static to_render_content($resp, $entry_uid, $live_response_decode)

No description

Parameters

$resp
$entry_uid
$live_response_decode

at line 506
static bool isKeySet(array $input = array(), string $key = '')

Validate the key is set or not

Parameters

array $input
  • input
string $key
  • key to check

Return Value

bool

at line 518
static bool isEmpty(object $input)

Validate the String

Parameters

object $input
  • object to check for empty

Return Value

bool

at line 530
static object getLastActivites(object $queryObject)

Get Last activities

Parameters

object $queryObject
  • query object

Return Value

object

at line 543
static object debug(object $input, bool $exit = false)

DEBUGGING MESSAGE

Parameters

object $input
  • object to debug
bool $exit
  • to exit on debug

Return Value

object