ZenMagick 0.9.8


org.zenmagick.store.mvc.Request
\store\mvc\Request.php at line 37

Class Request

ZMObject
└─ZMRequest
└─Request

public class Request
extends ZMRequest

Store request wrapper.

NOTE: For the time of transition between static and instance usage of request methods this will have a temp. name of ZMRequest.

Author:
DerManoMann
Version:
$Id: Request.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.mvc.ZMRequest
REQUEST_ID, SESSION_TOKEN_NAME
Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

Request(array parameter)

Create new instance.

Method Summary
ZMAccount

getAccount()

Get the account.

int

getAccountId()

Get the account id.

int

getCategoryId()

Get the current category id.

string

getCategoryPath()

Get the current category path.

array

getCategoryPathArray()

Get the category path arry.

string

getContext()

{@inheritDoc}

string

getCurrencyCode()

Get the currency code.

string

getLanguageCode()

Get the language code.

int

getManufacturerId()

Get the manufacturer id.

string

getModel()

Get the request model number.

int

getOrderId()

Get the current order id.

string

getPageBase()

Get the page base url.

int

getPageIndex()

Get the current page index (if available).

int

getProductId()

Get the product id.

string

getRequestId()

{@inheritDoc}

int

getReviewId()

Get the current review id.

ZMShoppingCart

getShoppingCart()

Get the current shopping cart.

string

getSortId()

Get the current sort id.

string

getSticky(boolean clear)

{@inheritDoc}

strin

getSubPageName()

Get the sub page name; this is the contents name for static pages.

boolean

isAdmin()

Check if we are running as admin.

boolean

isAnonymous()

Returns true if the user is not logged in at all.

boolean

isCheckout(boolean includeCart)

Checks, if the current page is a checkout page.

boolean

isGuest()

Returns true if the user is a guest user.

boolean

isRegistered()

Returns true if the user is fully registered and logged in.

void

markSticky()

{@inheritDoc}

void

redirect(string url, int status)

Save messages in session before redirect.

void

setCategoryPathArray(array cPath)

Set the category path arry.

void

setRequestId(string requestId)

{@inheritDoc}

Methods inherited from org.zenmagick.mvc.ZMRequest
getContext, getController, getHostname, getMethod, getParameter, getParameterMap, getQueryString, getRequestId, getSession, getSticky, getTemplatePath, getToolbox, instance, isSecure, markSticky, redirect, setController, setMethod, setParameter, setParameterMap, setRequestId, setSession, validateSessionToken
Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\mvc\Request.php at line 50

Request

public Request(array parameter)

Create new instance.

Parameters:
parameter - Optional request parameter; if null, $_GET and $_POST will be used.

Method Detail

\store\mvc\Request.php at line 232

getAccount

public ZMAccount getAccount()

Get the account.

Returns:
The account or null.

\store\mvc\Request.php at line 225

getAccountId

public int getAccountId()

Get the account id.

Returns:
The account id for the currently logged in user or 0.

\store\mvc\Request.php at line 189

getCategoryId

public int getCategoryId()

Get the current category id.

Returns:
The current category id or 0.

\store\mvc\Request.php at line 162

getCategoryPath

public string getCategoryPath()

Get the current category path.

Returns:
The category path value (cPath) or null.

\store\mvc\Request.php at line 169

getCategoryPathArray

public array getCategoryPathArray()

Get the category path arry.

Returns:
The current category path broken into an array of category ids.

\store\mvc\Request.php at line 325

getContext

public string getContext()

Returns:
The URL context.

\store\mvc\Request.php at line 148

getCurrencyCode

public 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 $request->getSession()->getCurrencyCode().

Returns:
The currency code or null.

\store\mvc\Request.php at line 137

getLanguageCode

public 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 Runtime::getLanguageId() or Runtime::getLanguage().

Returns:
The language code or null.

\store\mvc\Request.php at line 218

getManufacturerId

public int getManufacturerId()

Get the manufacturer id.

Returns:
The manufacturer id or 0.

\store\mvc\Request.php at line 155

getModel

public string getModel()

Get the request model number.

Returns:
The model numner or null.

\store\mvc\Request.php at line 253

getOrderId

public int getOrderId()

Get the current order id.

Returns:
The current order id or 0.

\store\mvc\Request.php at line 281

getPageBase

public string getPageBase()

Get the page base url.

Returns:
A base URL for the current request.

\store\mvc\Request.php at line 105

getPageIndex

public int getPageIndex()

Get the current page index (if available).

Returns:
The current page index (default is 1).

\store\mvc\Request.php at line 126

getProductId

public int getProductId()

Get the product id.

Returns:
The request product id or 0.

\store\mvc\Request.php at line 70

getRequestId

public string getRequestId()

Returns:
The value of the self::REQUEST_ID query parameter.

\store\mvc\Request.php at line 246

getReviewId

public int getReviewId()

Get the current review id.

Returns:
The current review id or 0.

\store\mvc\Request.php at line 87

getShoppingCart

public ZMShoppingCart getShoppingCart()

Get the current shopping cart.

Returns:
The current shopping cart (may be empty).

\store\mvc\Request.php at line 112

getSortId

public string getSortId()

Get the current sort id.

Returns:
The current sort id.

\store\mvc\Request.php at line 342

getSticky

public string getSticky(boolean clear)

Parameters:
clear - Optional flag to keep or clear the sticky url; default is true to clear.
Returns:
The url to go to or null.

\store\mvc\Request.php at line 119

getSubPageName

public strin getSubPageName()

Get the sub page name; this is the contents name for static pages.

Returns:
The static page contents id.

\store\mvc\Request.php at line 309

isAdmin

public boolean isAdmin()

Check if we are running as admin.

Returns:
true if code execution is in the context of an admin page, false if not.

\store\mvc\Request.php at line 260

isAnonymous

public boolean isAnonymous()

Returns true if the user is not logged in at all.

Returns:
true if the current user is guest, false if not.

\store\mvc\Request.php at line 298

isCheckout

public boolean isCheckout(boolean includeCart)

Checks, if the current page is a checkout page.

Parameters:
includeCart - If true, the shopping cart is considered a checkout page, too; (defaults to true)
Returns:
true if the current page is a checkout page.

\store\mvc\Request.php at line 274

isGuest

public boolean isGuest()

Returns true if the user is a guest user.

Returns:
true if the current user is guest, false if not.

\store\mvc\Request.php at line 267

isRegistered

public boolean isRegistered()

Returns true if the user is fully registered and logged in.

Returns:
true if the current user is fully registered and logged in, false if not.

\store\mvc\Request.php at line 332

markSticky

public void markSticky()


\store\mvc\Request.php at line 316

redirect

public void redirect(string url, int status)

Save messages in session before redirect.

Parameters:
url - A fully qualified url.
status - Optional status; default is 302 - FOUND.

\store\mvc\Request.php at line 204

setCategoryPathArray

public void setCategoryPathArray(array cPath)

Set the category path arry.

Parameters:
cPath - The category path as array.

\store\mvc\Request.php at line 77

setRequestId

public void setRequestId(string requestId)

Parameters:
requestId - The new request id.

ZenMagick 0.9.8