ZenMagick 0.9.1


org.zenmagick.service.ZMAccounts

Class ZMAccounts

ZMObject
|
+--ZMAccounts

public class ZMAccounts
extends ZMObject

Accounts.

Author:
mano
Version:
$Id: ZMAccounts.php 1119 2008-05-20 22:21:40Z DerManoMann $

Constructor Summary

ZMAccounts()

Create new instance.

Method Summary
ZMAccount

createAccount(ZMAccount account)

Create a new account.

boolean

emailExists(string email)

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

getSubscribedProductIds(int accountId)

Get subscribed product ids.

static void

instance()

Get instance.

boolean

isGlobalProductSubscriber(int accountId)

Check for global product subscriber.

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
backtrace, create, log, singleton

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 email)

Checks if a given email address exists.

Parameters:
email - 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.

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.

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.1