ZMObject
└─ZMProductAssociations
public class ZMProductAssociations
extends ZMObject
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| ZMProductAssociationHandler | getHandlerForType(string type) Get a handler for the given type. |
| array | Get all handler types. |
| array | getProductAssociationsForCategoryId(int categoryId, int type, array args, boolean all) Get associated products for the given category. |
| array | getProductAssociationsForProductId(int productId, int type, array args, boolean all) Get product associations for the given product, type and parameter. |
| array | getProductAssociationsForShoppingCart(ZMShoppingCart shoppingCart, int type, array args, boolean all) Get associated products for the given shopping cart. |
| static void | instance() Get instance. |
| void | registerHandler(mixed handler, mixed type) Register an association handler. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public void __construct()
Create new instance.
public ZMProductAssociationHandler getHandlerForType(string type)
Get a handler for the given type.
null.public array getHandlerTypes()
Get all handler types.
public array getProductAssociationsForCategoryId(int categoryId, int type, array args, boolean all)
Get associated products for the given category.
This is mostly a convenience method to avoid having to iterate over all products in a given category yourself.
This method will also take care of duplicates.
null for none.false.ZMProductAssociation instances.public array getProductAssociationsForProductId(int productId, int type, array args, boolean all)
Get product associations for the given product, type and parameter.
false.ZMProductAssociation instances.public array getProductAssociationsForShoppingCart(ZMShoppingCart shoppingCart, int type, array args, boolean all)
Get associated products for the given shopping cart.
This is mostly a convenience method to avoid having to iterate over all products in the given cart.
This method will also take care of duplicates.
null for none.false.ZMProductAssociation instances.public static void instance()
Get instance.
public void registerHandler(mixed handler, mixed type)
Register an association handler.
The optional $type parameter allows to register a
handler as string. If omitted, an instance of the handler will be
created immediately in order to query the type. This also allows to
register the same handler for different types, if required.
ZMProductAssociationHandler instance, or a class definition compatible with ZMBeanUtils::getBean(..).null.
Manage pluggable product associations.
Handler can be explicitely registered using the
registerHandler(..)method, or, preferrably via the setting 'defaultProductAssociationHandler' - as comma separated list of class names.