ZenMagick 0.9.10


zenmagick.store.shared.services.account\ZMAccounts
services\account\ZMAccounts.php at line 33

Class ZMAccounts

ZMObject
└─ZMAccounts

public class ZMAccounts
extends ZMObject

Accounts.

Author:
DerManoMann

Constant Summary
final static int

AUTHORIZATION_BLOCKED

final static int

$AUTHORIZATION_ENABLED

final static int

AUTHORIZATION_PENDING

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

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

getAllAccounts(string type, int limit)

Get all accounts.

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.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Constant Detail

services\account\ZMAccounts.php at line 37

AUTHORIZATION_BLOCKED

public final static int AUTHORIZATION_BLOCKED = 4

services\account\ZMAccounts.php at line 35

AUTHORIZATION_ENABLED

public final static int $AUTHORIZATION_ENABLED

services\account\ZMAccounts.php at line 36

AUTHORIZATION_PENDING

public final static int AUTHORIZATION_PENDING = 1

Method Detail

services\account\ZMAccounts.php at line 43

__construct

public void __construct()

Create new instance.


services\account\ZMAccounts.php at line 193

createAccount

public ZMAccount createAccount(ZMAccount account)

Create a new account.

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

services\account\ZMAccounts.php at line 177

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.

services\account\ZMAccounts.php at line 88

getAccountForEmailAddress

public ZMAccount getAccountForEmailAddress(string emailAddress)

Get account for the given email address.

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

services\account\ZMAccounts.php at line 68

getAccountForId

public ZMAccount getAccountForId(int accountId)

Get account for the given account id.

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

services\account\ZMAccounts.php at line 109

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.

services\account\ZMAccounts.php at line 132

getAllAccounts

public array getAllAccounts(string type, int limit)

Get all accounts.

Parameters:
type - Optional type (ZMAccount::REGISTERED, ZMAccount::GUEST); default is null for all.
limit - Optional limit; default is 0 for all.
Returns:
A ZMAccount instances.

services\account\ZMAccounts.php at line 285

getSubscribedProductIds

public array getSubscribedProductIds(int accountId)

Get subscribed product ids.

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

services\account\ZMAccounts.php at line 57

instance

public static void instance()

Get instance.


services\account\ZMAccounts.php at line 256

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.

services\account\ZMAccounts.php at line 242

setAccountPassword

public void setAccountPassword(mixed accountId, mixed password)

Set password for account


services\account\ZMAccounts.php at line 271

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.

services\account\ZMAccounts.php at line 303

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 updated account.

services\account\ZMAccounts.php at line 217

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.

services\account\ZMAccounts.php at line 162

updateAccountLoginStats

public void updateAccountLoginStats(int accountId)

Update account login stats.

Parameters:
accountId - The account id.

ZenMagick 0.9.10