ZMObject
|
+--ZMRequest
public class ZMRequest
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMRequest(array parameter) Create new instance. |
|
| Method Summary | |
|---|---|
| static ZMAccount | Get the account. |
| static int | Get the account id. |
| static int | Get the current category id. |
| static string | Get the current category path. |
| static array | Get the category path arry. |
| static ZMController | Get the controller for this request. |
| static string | Get the currency code. |
| static strng | Get the hostname for this request. |
| static string | Get the language code. |
| static int | Get the manufacturer id. |
| static string | Get the request method. |
| static string | getModel() Get the request model number. |
| static int | Get the current order id. |
| static string | Get the page base url. |
| static int | Get the current page index (if available). |
| static string | Get the current page name; ie the ZM_PAGE_KEY value. |
| static mixed | getParameter(string name, mixed default, boolean sanitize) Generic access method for request parameter. |
| static array | getParameterMap(boolean sanitize) Get the complete parameter map. |
| static int | Get the product id. |
| static string | Get the full query string. |
| static int | Get the current review id. |
| static ZMSession | Get the current session. |
| static ZMShoppingCart | Get the current shopping cart. |
| static string | Get the current sort id. |
| static strin | Get the sub page name; this is the contents name for static pages. |
| protected static void | instance() Get instance. |
| static boolean | isAdmin() Check if we are running as admin. |
| static boolean | Returns true if the user is not logged in at all. |
| static boolean | isCheckout(boolean includeCart) Checks, if the current page is a checkout page. |
| static boolean | isGuest() Returns true if the user is a guest user. |
| static boolean | Returns true if the user is fully registered and logged in. |
| static boolean | isSecure() Checks if the current request is secure or note. |
| static boolean | Check for a valid session. |
| static void | redirect(string url, int status) Redirect to the given url. |
| static void | setCategoryPathArray(array cPath) Set the category path arry. |
| static void | setController(ZMController controller) Set the current controller. |
| static mixed | setParameter(string name, mixed value) Allow programmatic manipulation of request parameters. |
| static void | setParameterMap(array map) Set the parameter map. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMRequest(array parameter)
Create new instance.
null,
* $_GET and $_POST will be used.public static ZMAccount getAccount()
Get the account.
null.public static int getAccountId()
Get the account id.
0.public static int getCategoryId()
Get the current category id.
0.public static string getCategoryPath()
Get the current category path.
cPath) or null.public static array getCategoryPathArray()
Get the category path arry.
public static ZMController getController()
Get the controller for this request.
public static string getCurrencyCode()
Get the currency code.
NOTE: This will return the currency code as found in the request. If not set,
the session currency code will be returned instead. To access the session currency code directly, use
ZMRequest::getSession()->getCurrencyCode().
null.public static strng getHostname()
Get the hostname for this request.
public static string getLanguageCode()
Get the language code.
NOTE: This will return only the language code as found in the request. If you
want to find out the session language (ie the language for the current request), use ZMRuntime::getLanguageId()
or ZMRuntime::getLanguage().
null.public static int getManufacturerId()
Get the manufacturer id.
0.public static string getMethod()
Get the request method.
public static string getModel()
Get the request model number.
null.public static int getOrderId()
Get the current order id.
0.public static string getPageBase()
Get the page base url.
public static int getPageIndex()
Get the current page index (if available).
public static string getPageName()
Get the current page name; ie the ZM_PAGE_KEY value.
ZM_PAGE_KEY query parameter.public static mixed getParameter(string name, mixed default, boolean sanitize)
Generic access method for request parameter.
This method is evaluating both GET and POST parameter.
There is a special case for when a parameter is not found, but _[name] is found. In this
case false is returned. This allows to handle checkboxes same as any other form element
by adding a hidden field _[name] with the original value.
null is used).true, sanitze value; default is true.null.public static array getParameterMap(boolean sanitize)
Get the complete parameter map.
true, sanitze value; default is true.public static int getProductId()
Get the product id.
0.public static string getQueryString()
Get the full query string.
public static int getReviewId()
Get the current review id.
0.public static ZMSession getSession()
Get the current session.
public static ZMShoppingCart getShoppingCart()
Get the current shopping cart.
public static string getSortId()
Get the current sort id.
public static strin getSubPageName()
Get the sub page name; this is the contents name for static pages.
protected static void instance()
Get instance. /
public static boolean isAdmin()
Check if we are running as admin.
true if code execution is in the context of an admin page,
* false if not.public static boolean isAnonymous()
Returns true if the user is not logged in at all.
true if the current user is guest, false if not.public static boolean isCheckout(boolean includeCart)
Checks, if the current page is a checkout page.
true, the shopping cart is considered a checkout page, too; (defaults to true)true if the current page is a checkout page.public static boolean isGuest()
Returns true if the user is a guest user.
true if the current user is guest, false if not.public static boolean isRegistered()
Returns true if the user is fully registered and logged in.
true if the current user is fully registered and logged in, false if not.public static boolean isSecure()
Checks if the current request is secure or note.
true if the current request is secure; eg. SSL, false if not.public static boolean isValidSession()
Check for a valid session.
true if a valid session exists, false if not.public static void redirect(string url, int status)
Redirect to the given url.
This method wil also persist existing messages in the session in order to be able to display them after the redirect.
public static void setCategoryPathArray(array cPath)
Set the category path arry.
public static void setController(ZMController controller)
Set the current controller.
public static mixed setParameter(string name, mixed value)
Allow programmatic manipulation of request parameters.
null.public static void setParameterMap(array map)
Set the parameter map.
A central place for all request/session stuff.