ZenMagick 0.9.1


org.zenmagick.service.ZMBanners

Class ZMBanners

ZMObject
|
+--ZMBanners

public class ZMBanners
extends ZMObject

Banner.

Author:
mano
Version:
$Id: ZMBanners.php 1071 2008-04-22 02:14:36Z DerManoMann $

Constructor Summary

ZMBanners()

Create new instance.

Method Summary
array

getAllBanners()

Get all banner according to zen-cart configuration.

mixed

getBannerForId(integer id)

Get a banner for the given id.

mixed

getBannerForIndex(integer index)

Get a banner for the given (zen-cart) index.

private array

getBannerForName(string identifiers, boolean all)

Get one (random) or more banner based on the given banner group(s).

static void

instance()

Get instance.

void

updateBannerClickCount(int bannerId)

Update banner click statistics.

void

updateBannerDisplayCount(int bannerId)

Update banner display count.

Methods inherited from org.zenmagick.ZMObject
backtrace, create, log, singleton

Constructor Detail

ZMBanners

public ZMBanners()

Create new instance. /


Method Detail

getAllBanners

public array getAllBanners()

Get all banner according to zen-cart configuration.

this will return all banner as configured using the zen-cart define SHOW_BANNERS_GROUP_SET_ALL.

Returns:
A list of ZMBanner instances.

getBannerForId

public mixed getBannerForId(integer id)

Get a banner for the given id.

Parameters:
id - The banner id.
Returns:
A ZMBanner instance or null.

getBannerForIndex

public mixed getBannerForIndex(integer index)

Get a banner for the given (zen-cart) index.

The index is based on the zen-cart defines for banner; eg: SHOW_BANNERS_GROUP_SET3. Here the index would be three.

Parameters:
index - The zen-cart index.
Returns:
A ZMBanner instance or null.

getBannerForName

private array getBannerForName(string identifiers, boolean all)

Get one (random) or more banner based on the given banner group(s).

If $all is set to true, all matching banners will be returned.

Thus, getAllBanner() translates into getBannerForName(SHOW_BANNERS_GROUP_SET_ALL, true).

Parameters:
identifiers - One ore more identifiers, separated by ':'.
all - If set to true, all banners will be returned, ordered in * the configured sort order.
Returns:
A list of ZMBanner instances.

instance

public static void instance()

Get instance. /


updateBannerClickCount

public void updateBannerClickCount(int bannerId)

Update banner click statistics.

Parameters:
bannerId - The banner id.

updateBannerDisplayCount

public void updateBannerDisplayCount(int bannerId)

Update banner display count.

Parameters:
bannerId - The banner id.

ZenMagick 0.9.1