\CMSubscriber
Represents a subscriber within the Campaign Monitor database
- Author: Damian Mooyman
Synopsis
class CMSubscriber
extends LazyLoadedCMObject
{
- // members
- protected CMList $list = NULL;
- protected $originalEmail = NULL;
- protected array $customFields = ;
- // Inherited members from LazyLoadedCMObject
- protected boolean $hasLoadedFullDetails;
- // Inherited members from CMObject
- protected array $record;
- // Inherited members from CMBase
- protected $apiKey;
- // methods
- public array getCustomFields()
- public void setCustomFields()
- public mixed getCustomField()
- public void setCustomField()
- public void __construct()
- public void populateFrom()
- public void serializeData()
- public CMList getList()
- public void setList()
- protected CS_REST_Subscribers buildRestInterface()
- public void isNew()
- public void getID()
- public void setID()
- public void getTitle()
- public void setTitle()
- protected void loadFullDetails()
- public void Save()
- public void LoadByEmailAndList()
- // Inherited methods from LazyLoadedCMObject
- 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 - $customFields
—
array
Custom fields for this subscriber - $hasLoadedFullDetails
—
boolean
Flag indicating whether all lazy loaded fields have been loaded - $list
—
CMList
The list this subscriber belongs to - $originalEmail
—
string
Original email address for the subscriber, only to be changed each update - $record
—
array
Stored data for this object. May contain nested data
Methods
protected
- buildRestInterface() — Prepares a CM REST interface object for loading and saving data for this record
- loadFullDetails()
public
- __construct() — Create a new subscriber record
- LoadByEmailAndList() — Loads a subscriber details from a list by email address
- Save()
- getCustomField() — Retrieves the value for a specified custom field
- getCustomFields() — Gets the list of all custom fields
- getID()
- getList() — Retrieves the list this subscriber belongs to
- getTitle()
- isNew()
- populateFrom()
- serializeData()
- setCustomField() — Sets the value for a specified custom field
- setCustomFields() — Replaces the list of custom fields with another
- setID()
- setList() — Sets the list this subscriber belongs to without saving it
- setTitle()
Inherited from LazyLoadedCMObject
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