class TemplateModel extends BaseModel (View source)

Simple model that represents a template.

Methods

__construct(array $configuration)

The constructor of a Klaviyo data model.

__get($property)

PHPs magic get method to provide access to our protected attributes.

from BaseModel
$this
__set($property, $value)

PHPs magic set method to provide access to our mutable attributes.

static KlaviyoModel
create(array $configuration = array())

Helper method to create the data model.

from BaseModel
static KlaviyoModel
createFromJson(array $json = '')

Helper method to create the data model from a JSON array.

from BaseModel
jsonSerialize()

{@inheritdoc}

toArray()

Convert the model to an array.

from BaseModel
$this
setHtml(DOMDocument|string $value)

Set the html value.

getHtmlObjectFromString(string $content)

Retrieve an HTML object from the specified string.

Details

at line line 27
__construct(array $configuration)

The constructor of a Klaviyo data model.

Parameters

array $configuration The key, value pair array to use for populating the data model.

in BaseModel at line line 37
__get($property)

PHPs magic get method to provide access to our protected attributes.

Parameters

$property

at line line 41
$this __set($property, $value)

PHPs magic set method to provide access to our mutable attributes.

Parameters

$property
$value

Return Value

$this

in BaseModel at line line 65
static KlaviyoModel create(array $configuration = array())

Helper method to create the data model.

Parameters

array $configuration The key, value pair array to use for populating the data model.

Return Value

KlaviyoModel An instance of the Klaviyo data model.

in BaseModel at line line 78
static KlaviyoModel createFromJson(array $json = '')

Helper method to create the data model from a JSON array.

Parameters

array $json The configuration json to use for populating the data model.

Return Value

KlaviyoModel An instance of the Klaviyo data model.

at line line 90
jsonSerialize()

{@inheritdoc}

in BaseModel at line line 98
toArray()

Convert the model to an array.

at line line 59
$this setHtml(DOMDocument|string $value)

Set the html value.

Parameters

DOMDocument|string $value The HTML for the template. The value may be either a string or a DOMDocument.

Return Value

$this

at line line 81
DOMDocument getHtmlObjectFromString(string $content)

Retrieve an HTML object from the specified string.

Parameters

string $content The valid HTML to transform into an HTML object.

Return Value

DOMDocument The HTML object that may used to manipulate the DOM.