ZenMagick 0.9.10


zenmagick.store.shared.services\ZMBanners
services\ZMBanners.php at line 33

Class ZMBanners

ZMObject
└─ZMBanners

public class ZMBanners
extends ZMObject

Banner.

Author:
DerManoMann

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

__construct()

Create new instance.

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

Method Detail

services\ZMBanners.php at line 38

__construct

public void __construct()

Create new instance.


services\ZMBanners.php at line 81

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.

services\ZMBanners.php at line 136

getBannerForId

public mixed getBannerForId(integer id)

Get a banner for the given id.

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

services\ZMBanners.php at line 69

getBannerForSet

public mixed getBannerForSet(string name)

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

A banner set is 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.

services\ZMBanners.php at line 95

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.

services\ZMBanners.php at line 52

instance

public static void instance()

Get instance.


services\ZMBanners.php at line 178

updateBannerClickCount

public void updateBannerClickCount(int bannerId)

Update banner click statistics.

Parameters:
bannerId - The banner id.

services\ZMBanners.php at line 154

updateBannerDisplayCount

public void updateBannerDisplayCount(int bannerId)

Update banner display count.

Parameters:
bannerId - The banner id.

ZenMagick 0.9.10