ZMObject
|
+--ZMProducts
public class ZMProducts
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | |
| final mixed | |
| final mixed | |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| array | getAllProducts(boolean active, int languageId) Get all products. |
| protected ZMQueryDetails | getAllProductsQueryDetails(boolean active, int languageId) Get all products. |
| array | getBestSellers(int categoryId, int max, int languageId) Get best seller products. |
| array | getFeaturedProducts(int categoryId, int max, boolean includeChildren, int languageId) Get random featured products. |
| array | getNewProducts(int categoryId, int max, int timeLimit, int languageId) Get random new products. |
| ZMProduct | getProductForId(int productId, int languageId) Get a product for the given product id. |
| ZMProduct | getProductForModel(string model, int languageId) Get a product for the given model name. |
| private array | getProductIds(string sql, array args, mixed tables) Execute the given SQL and extract the resulting product ids. |
| array | getProductIdsForCategoryId(int categoryId, boolean active, boolean includeChildren, int languageId) Get list of all active product ids for a given category. |
| boolean | getProductTypeSetting(int productId, string field, mixed keyPprefix, string keySuffix, string fieldPrefix, string fieldSuffix, string keyPrefix) Test if a given product type option is enabled for a given product. |
| array | getProductsForCategoryId(int categoryId, boolean active, int languageId) Get all (active) products for the given category id. |
| protected array | getProductsForCategoryIdQueryDetails(int categoryId, boolean active, int languageId) Get all (active) products for the given category id. |
| ZMProduct | getProductsForIds(array productIds, boolean preserveOrder, int languageId) Load a list of products. |
| void | getProductsForManufacturerId(mixed manufacturerId, mixed active, mixed languageId) |
| array | getProductsForSQL(string sql, int languageId) Execute the given SQL and return the resulting product. |
| void | getQueryDetails(mixed method, mixed args) {@inheritDoc} / |
| private array | getRandomProductIds(string sql, int max, array args, mixed tables) Get some random product ids. |
| array | getSpecials(int max, int languageId) Get random products marked as specials. |
| static void | instance() Get instance. |
| boolean | isQuantityAvailable(int productId, int quantity) Check if a certain quantity of a given product is available. |
| ZMProduct | updateProduct(ZMProduct product) Update an existing product. |
| void | updateViewCount(int productId, int languageId) Update the view count for a product. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed IMAGE_LARGE = 'large'
public final mixed IMAGE_MEDIUM = 'medium'
public final mixed IMAGE_SMALL = 'small'
public ZMProducts()
Create new instance. /
public array getAllProducts(boolean active, int languageId)
Get all products.
true return only active products; default is true.null for session language.ZMProduct instances.protected ZMQueryDetails getAllProductsQueryDetails(boolean active, int languageId)
Get all products.
true return only active products; default is true.null for session language.public array getBestSellers(int categoryId, int max, int languageId)
Get best seller products.
null for all.null to use the setting maxBestSellers.null for session language.ZMProduct instances.public array getFeaturedProducts(int categoryId, int max, boolean includeChildren, int languageId)
Get random featured products.
null for all.0 for all.false.null for session language.ZMProduct instances.public array getNewProducts(int categoryId, int max, int timeLimit, int languageId)
Get random new products.
null for all.0 for all.null for session language.ZMProduct instances.public ZMProduct getProductForId(int productId, int languageId)
Get a product for the given product id.
null for session language.null.public ZMProduct getProductForModel(string model, int languageId)
Get a product for the given model name.
null for session language.null.private array getProductIds(string sql, array args, mixed tables)
Execute the given SQL and extract the resulting product ids.
TABLE_PRODUCTS.public array getProductIdsForCategoryId(int categoryId, boolean active, boolean includeChildren, int languageId)
Get list of all active product ids for a given category.
This is a faster version of getProductsForCategoryId(int). In addition,
this will ignore language preferences.
true return only active products; default is true.false.null for session language.public boolean getProductTypeSetting(int productId, string field, mixed keyPprefix, string keySuffix, string fieldPrefix, string fieldSuffix, string keyPrefix)
Test if a given product type option is enabled for a given product.
true if the specified type option is enabled, false if not.public array getProductsForCategoryId(int categoryId, boolean active, int languageId)
Get all (active) products for the given category id.
true return only active products; default is true.null for session language.ZMProduct instances.protected array getProductsForCategoryIdQueryDetails(int categoryId, boolean active, int languageId)
Get all (active) products for the given category id.
true return only active products; default is true.null for session language.ZMProduct instances.public ZMProduct getProductsForIds(array productIds, boolean preserveOrder, int languageId)
Load a list of products.
false.null for session language.null.public void getProductsForManufacturerId(mixed manufacturerId, mixed active, mixed languageId)
public array getProductsForSQL(string sql, int languageId)
Execute the given SQL and return the resulting product.
null for session language.ZMProduct instances.public void getQueryDetails(mixed method, mixed args)
/
private array getRandomProductIds(string sql, int max, array args, mixed tables)
Get some random product ids.
TABLE_PRODUCTS.public array getSpecials(int max, int languageId)
Get random products marked as specials.
null to use the setting maxSpecialProducts.null for session language.ZMProduct instances.public static void instance()
Get instance. /
public boolean isQuantityAvailable(int productId, int quantity)
Check if a certain quantity of a given product is available.
true if the requested quantity is available, false if not.public ZMProduct updateProduct(ZMProduct product)
Update an existing product.
NOTE: Currently only the products table is updated!
public void updateViewCount(int productId, int languageId)
Update the view count for a product.
null for session language.
Product access.