\LazyLoadedCMObject
Represents a Campaign Monitor data record that may have fields loaded on an as needed basis.
- Author: Damian Mooyman
Synopsis
class LazyLoadedCMObject
extends CMObject
{
- // members
- protected boolean $hasLoadedFullDetails = false;
- // Inherited members from CMObject
- protected array $record;
- // Inherited members from CMBase
- protected $apiKey;
- // methods
- protected abstract void loadFullDetails()
- public void LoadByID()
- public void hasField()
- // Inherited methods from CMObject
- public array serializeData()
- public void __construct()
- protected array convertToArray()
- protected void populateFrom()
- public boolean isNew()
- public void hasField()
- public void getField()
- public void setField()
- public abstract void Save()
- // Inherited methods from CMBase
- public void __construct()
- protected void checkResult()
- protected type parseResult()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
24+ | : Merge new data with changed data |
Members
protected
- $apiKey
—
string
The API key used for future requests - $hasLoadedFullDetails
—
boolean
Flag indicating whether all lazy loaded fields have been loaded - $record
—
array
Stored data for this object. May contain nested data
Methods
protected
- loadFullDetails() — Lazy load full details for this client warning: Will overwrite any changed data in $record
public
- LoadByID() — Loads full details into this object from a record with the given id
- hasField()
Inherited from CMObject
protected
- convertToArray() — Parses a stdObject into a nested array recursively, in a format suitable for $this->record
- populateFrom() — Populates the object from the given data
public
- Save() — Saves the object to the database
- getField()
- hasField()
- isNew() — Determine if this is a new object, or one that exists in the database
- serializeData() — Serialises the data into a format suitable to be sent via the CM api.
- setField()
Inherited from CMBase
protected
- checkResult() — Checks that a result is successful
- parseResult() — Safely extracts results from a CM API call