PersonModel
class PersonModel extends BaseModel (View source)
Simple model for a Klaviyo "Person".
Methods
The constructor of a Klaviyo data model.
PHPs magic get method to provide access to our protected attributes.
PHPs magic set method to provide access to our mutable attributes.
Helper method to create the data model.
Helper method to create the data model from a JSON array.
{@inheritdoc}
Convert the model to an array.
Update the person model from an array.
Retrieve an array of all attribute keys.
Determine if the attribute is a custom attribute.
Determine if the attribute is a special attribute.
Retrieve a custom attribute by its attribute key.
Retrieve all custom attributes for the person.
Delete an attribute from the person model.
Retrieve the model property from the special attribute key.
Details
at line line 59
__construct(array $configuration)
The constructor of a Klaviyo data model.
__get($property)
PHPs magic get method to provide access to our protected attributes.
$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.
at line line 68
static KlaviyoModel
createFromJson(array $json)
Helper method to create the data model from a JSON array.
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.
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.
at line line 149
static bool
isSpecialAttributeKey($attribute_key)
Determine if the attribute is a special attribute.
at line line 156
getCustomAttribute($attribute_key)
Retrieve a custom attribute by its 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.
at line line 200
static string
getModelPropertyFromSpecialAttributeKey(string $attribute_key)
Retrieve the model property from the special attribute key.