ZMObject
└─ZMBanners
public class ZMBanners
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| array | 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 | |
public ZMBanners()
Create new instance.
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.
ZMBanner instances.public mixed getBannerForId(integer id)
Get a banner for the given id.
ZMBanner instance or null.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');
ZMBanner instance or null.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.
true, all banners will be returned, ordered in the configured sort order; default is false to shuffle results.ZMBanner instances.public static void instance()
Get instance.
public void updateBannerClickCount(int bannerId)
Update banner click statistics.
public void updateBannerDisplayCount(int bannerId)
Update banner display count.
Banner.