ZenMagick 0.9.8


org.zenmagick.store.services.ZMBanners
\store\services\ZMBanners.php at line 34

Class ZMBanners

ZMObject
└─ZMBanners

public class ZMBanners
extends ZMObject

Banner.

Author:
DerManoMann
Version:
$Id: ZMBanners.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
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

getBannerForSet(string name)

Get a random, single banner for the given symbolic banner group set (yes!) name.

protected array

getBannersForGroupName(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.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\services\ZMBanners.php at line 39

ZMBanners

public ZMBanners()

Create new instance.


Method Detail

\store\services\ZMBanners.php at line 82

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.

\store\services\ZMBanners.php at line 137

getBannerForId

public mixed getBannerForId(integer id)

Get a banner for the given id.

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

\store\services\ZMBanners.php at line 70

getBannerForSet

public mixed getBannerForSet(string name)

Get a random, single banner for the given symbolic banner group set (yes!) name.

A banner set is a either a single banner group or a list of banner groups.

Banner sets can be configured by creating a setting with the format: banners.[NAME], with banners. being a fixed prefix and [NAME] the name of the set.

Example: ZMSettings::set('banners.mygroup', 'Wide-Banners');

Parameters:
name - A banner group set name.
Returns:
A ZMBanner instance or null.

\store\services\ZMBanners.php at line 96

getBannersForGroupName

protected array getBannersForGroupName(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.

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

\store\services\ZMBanners.php at line 53

instance

public static void instance()

Get instance.


\store\services\ZMBanners.php at line 179

updateBannerClickCount

public void updateBannerClickCount(int bannerId)

Update banner click statistics.

Parameters:
bannerId - The banner id.

\store\services\ZMBanners.php at line 155

updateBannerDisplayCount

public void updateBannerDisplayCount(int bannerId)

Update banner display count.

Parameters:
bannerId - The banner id.

ZenMagick 0.9.8