Accounts

OMC_Account

Die Klasse OMC_Account repräsentiert im OMC Connector (PHP) die im Online Marketing Cockpit gespeicherten Accounts. Die Instanzmethoden dieser Klasse finden Sie weiter unten in diesem Dokument.

Klassenmethoden
OMC_Account __construct([array $fields = array()])

Aufgabe: Erstellt eine neue lokale Instanz eines Accounts.
Zugriff: $neuer_account = new OMC_Account();
Rückgabewert: Die Instanz des Accounts.
Exceptions: –

OMC_Account create([array $properties = array()])

Aufgabe: Erstellt einen Account im OMC mit den gegebenen Feldern.
Rückgabewert: Die erstellte Instanz des Accounts.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceInvalidException

OMC_Account find(integer $scope, [array $params = array()])

Aufgabe: Findet einen Account anhand der gegebenen ID ($scope) im OMC.
Rückgabewert: Die Instanz des Accounts.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceNotFoundException

Instanzmethoden
array<OMC_Conact> getContacts()

Aufgabe: Listet alle Kontaktpersonen dieses Accounts auf.
Zugriff: $account->contacts
Rückgabewert: Ein Array von Instanzen von Kontaktpersonen.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceNotFoundException

array getFields()

Aufgabe: Listet alle nicht leeren Felder dieses Accounts auf.
Rückgabewert: Ein Array mit Name/Wert-Paaren unterschiedlichen Typs (String, Integer, Boolean usw.)
Exceptions: –

array<OMC_Inquiry> getInquiries()

Aufgabe: Listet alle diesem Account zugeordneten Anfragen auf.
Zugriff: $account->inquiries
Rückgabewert: Ein Array von Instanzen von Anfragen.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceNotFoundException

array<OMC_Location> getLocations([$reload = false])

Aufgabe: Listet alle Standorte dieses Accounts auf.
Zugriff: $account->locations
Rückgabewert: Ein Array von Instanzen von Standorten.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceNotFoundException

boolean isNewRecord()

Aufgabe: Überprüft, ob dieser Account bereits im OMC existiert.
Rückgabewert: true, wenn es sich um einen bisher noch nicht gespeicherten Account handelt.
Exceptions: –

boolean updateAttributes(array $attributes)

Aufgabe: Ändert die Attribute (Felder) dieses Accounts und speichert diese im OMC.
Rückgabewert: Meldet, ob die Änderungen erfolgreich waren.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceInvalidException

void updateFields(array $fields)

Aufgabe: Überschreibt die angegebenen Felder aus $fields im Account lokal. Felder, die der Account hat, die jedoch nicht in $fields angegeben sind, werden nicht gelöscht oder überschrieben.
Rückgabewert: –
Exceptions: –

boolean save()

Aufgabe: Speichert die lokalen Änderungen dieses Accounts im OMC, oder erstellt einen neuen Account, wenn dessen ID im OMC nicht existiert.
Rückgabewert: Meldet, ob das Speichern erfolgreich war.
Exceptions: OMC_UnauthorizedAccessException, OMC_ResourceInvalidException