ZenMagick 0.9.6


org.zenmagick.service.ZMAccounts

Class ZMAccounts

ZMObject
|
+--ZMAccounts

public class ZMAccounts
extends ZMObject

Accounts.

Author:
DerManoMann
Version:
$Id: ZMAccounts.php 2100 2009-03-23 04:24:25Z dermanomann $

Field Summary
final mixed

AUTHORIZATION_BLOCKED

final mixed

$AUTHORIZATION_ENABLED

final mixed

AUTHORIZATION_PENDING

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMAccounts()

Create new instance.

Method Summary
ZMAccount

createAccount(ZMAccount account)

Create a new account.

boolean

emailExists(string emailAddress)

Checks if a given email address exists.

ZMAccount

getAccountForEmailAddress(string emailAddress)

Get account for the given email address.

ZMAccount

getAccountForId(int accountId)

Get account for the given account id.

array

getAccountsForEmailAddress(string emailAddress)

Get all accounts (guest and registered( for the given email address.

array

getSubscribedProductIds(int accountId)

Get subscribed product ids.

static void

instance()

Get instance.

boolean

isGlobalProductSubscriber(int accountId)

Check for global product subscriber.

void

setAccountPassword(mixed accountId, mixed password)

Set password for account /

void

setGlobalProductSubscriber(int accountId, boolean globalProductSubscriber)

Set the global product subscriber flag

ZMAccount

setSubscribedProductIds(ZMAccount account, array productIds)

Set subscribed product ids.

ZMAccount

updateAccount(mixed account, ZMAccount The)

Update an existing account.

void

updateAccountLoginStats(int accountId)

Update account login stats.

Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

AUTHORIZATION_BLOCKED

public final mixed AUTHORIZATION_BLOCKED = 4

AUTHORIZATION_ENABLED

public final mixed $AUTHORIZATION_ENABLED

AUTHORIZATION_PENDING

public final mixed AUTHORIZATION_PENDING = 1

Constructor Detail

ZMAccounts

public ZMAccounts()

Create new instance. /


Method Detail

createAccount

public ZMAccount createAccount(ZMAccount account)

Create a new account.

Parameters:
account - The new account.
Returns:
The created account incl. the new account id.

emailExists

public boolean emailExists(string emailAddress)

Checks if a given email address exists.

Parameters:
emailAddress - The email address.
Returns:
true if the email address exists, false if not.

getAccountForEmailAddress

public ZMAccount getAccountForEmailAddress(string emailAddress)

Get account for the given email address.

Parameters:
emailAddress - The email address.
Returns:
A ZMAccount instance or null.

getAccountForId

public ZMAccount getAccountForId(int accountId)

Get account for the given account id.

Parameters:
accountId - The account id.
Returns:
A ZMAccount instance or null.

getAccountsForEmailAddress

public array getAccountsForEmailAddress(string emailAddress)

Get all accounts (guest and registered( for the given email address.

Parameters:
emailAddress - The email address.
Returns:
A ZMAccount instances.

getSubscribedProductIds

public array getSubscribedProductIds(int accountId)

Get subscribed product ids.

Parameters:
accountId - The account id.
Returns:
A list of subscribed product ids.

instance

public static void instance()

Get instance. /


isGlobalProductSubscriber

public boolean isGlobalProductSubscriber(int accountId)

Check for global product subscriber.

Parameters:
accountId - The account id.
Returns:
true if the account is a global product subscriber, false if not.

setAccountPassword

public void setAccountPassword(mixed accountId, mixed password)

Set password for account /


setGlobalProductSubscriber

public void setGlobalProductSubscriber(int accountId, boolean globalProductSubscriber)

Set the global product subscriber flag

Parameters:
accountId - The account id.
globalProductSubscriber - true if global product is selected, false if not.

setSubscribedProductIds

public ZMAccount setSubscribedProductIds(ZMAccount account, array productIds)

Set subscribed product ids.

Parameters:
account - The account.
productIds - The new list of subscribed product ids.
Returns:
The aupdated account.

updateAccount

public ZMAccount updateAccount(mixed account, ZMAccount The)

Update an existing account.

NOTE: This will not update product notification changes!

Use setGlobalProductSubscriber(..) and setSubscribedProductIds(..) * to update product subscriptions.

Parameters:
The - account.
Returns:
The updated account.

updateAccountLoginStats

public void updateAccountLoginStats(int accountId)

Update account login stats.

Parameters:
accountId - The account id.

ZenMagick 0.9.6