class PersonModel extends BaseModel (View source)

Simple model for a Klaviyo "Person".

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.

from BaseModel
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.

jsonSerialize()

{@inheritdoc}

toArray()

Convert the model to an array.

$this
updateFromArray($configuration)

Update the person model from an array.

static 
getAttributeKeys()

Retrieve an array of all attribute keys.

static bool
isCustomAttributeKey($attribute_key)

Determine if the attribute is a custom attribute.

static bool
isSpecialAttributeKey($attribute_key)

Determine if the attribute is a special attribute.

getCustomAttribute($attribute_key)

Retrieve a custom attribute by its attribute key.

getAllCustomAttributes()

Retrieve all custom attributes for the person.

$this
deleteAttribute(string $attribute_key)

Delete an attribute from the person model.

static string
getModelPropertyFromSpecialAttributeKey(string $attribute_key)

Retrieve the model property from the special attribute key.

Details

at line line 59
__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

in BaseModel at line line 48
$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.

at line line 68
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 219
jsonSerialize()

{@inheritdoc}

at line line 247
toArray()

Convert the model to an array.

at line line 109
$this updateFromArray($configuration)

Update the person model from an array.

Parameters

$configuration

Return Value

$this

at line line 119
static getAttributeKeys()

Retrieve an array of all attribute keys.

at line line 138
static bool isCustomAttributeKey($attribute_key)

Determine if the attribute is a custom attribute.

Parameters

$attribute_key

Return Value

bool Returns TRUE if the attribute is considered to be a custom attribute.

at line line 149
static bool isSpecialAttributeKey($attribute_key)

Determine if the attribute is a special attribute.

Parameters

$attribute_key

Return Value

bool Returns TRUE if the attribute is considered to be a "special" Klaviyo attribute.

at line line 156
getCustomAttribute($attribute_key)

Retrieve a custom attribute by its attribute key.

Parameters

$attribute_key

at line line 163
getAllCustomAttributes()

Retrieve all custom attributes for the person.

at line line 175
$this deleteAttribute(string $attribute_key)

Delete an attribute from the person model.

Parameters

string $attribute_key The attribute key of the attribute to delete.

Return Value

$this

at line line 200
static string getModelPropertyFromSpecialAttributeKey(string $attribute_key)

Retrieve the model property from the special attribute key.

Parameters

string $attribute_key The special attribute key for which to retrieve the model property.

Return Value

string The string representing the model property.