mojavi
[ class tree: mojavi ] [ index: mojavi ] [ all elements ]

Class: Request

Source Location: /Request.class.php

Class Overview


Request encapsulates a request into a class, which provides easy-to-manage methods for directly accessing request information.


Author(s):

  • Sean Kerr

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Request encapsulates a request into a class, which provides easy-to-manage methods for directly accessing request information.



Tags:

since:  1.0
author:  Sean Kerr


[ Top ]


Class Methods


constructor Request [line 103]

Request &Request( array &$params)

Create a new Request instance.



Tags:

since:  1.0
access:  public


Parameters:

array   &$params   A parsed array of user submitted parameters.

[ Top ]

method getAttribute [line 125]

mixed &getAttribute( string $name)

Retrieve an attribute.



Tags:

return:  An attribute value, if the given attribute exists, otherwise NULL.
since:  1.0
access:  public


Parameters:

string   $name   An attribute name.

[ Top ]

method getAttributeNames [line 147]

array getAttributeNames( )

Retrieve an indexed array of attribute names.



Tags:

return:  An array of attribute names.
since:  1.0
access:  public


[ Top ]

method getAttributes [line 162]

array &getAttributes( )

Retrieve an associative array of all attributes.



Tags:

return:  An array of attributes.
since:  1.0
access:  public


[ Top ]

method getCookie [line 180]

string &getCookie( string $name)

Retrieve a cookie.



Tags:

return:  A cookie value, if the given cookie exists, otherwise NULL.
since:  2.0
access:  public


Parameters:

string   $name   A cookie name.

[ Top ]

method getCookieNames [line 202]

array getCookieNames( )

Retrieve an indexed array of cookie names.



Tags:

return:  An array of cookie names.
since:  2.0
access:  public


[ Top ]

method getCookies [line 217]

array &getCookies( )

Retrieve an associative array of cookies.



Tags:

return:  An array of cookies.
since:  2.0
access:  public


[ Top ]

method getError [line 238]

string getError( string $name)

Retrieve an error message.



Tags:

return:  An error message, if a validation error has occured for the given parameter or was manually set by the developer, otherwise NULL.
since:  1.0
access:  public


Parameters:

string   $name   The name under which the message has been registered. If the error is validation related, it will be registered under a parameter name.

[ Top ]

method getErrors [line 255]

array &getErrors( )

Retrieve an associative array of errors.



Tags:

return:  An array of errors, if any errors occured during validation or were manually set by the developer, otherwise NULL.
since:  1.0
access:  public


[ Top ]

method getMethod [line 275]

int getMethod( )

Retrieve the request method used for this request.



Tags:

return:  

A request method that is one of the following:

  • REQ_GET - serve GET requests
  • REQ_POST - serve POST requests

since:  2.0
access:  public


[ Top ]

method getParameter [line 294]

mixed &getParameter( string $name, [mixed $value = 'NULL'])

Retrieve a user submitted parameter.



Tags:

return:  A parameter value, if the given parameter exists, otherwise NULL.
since:  1.0
access:  public


Parameters:

string   $name   A parameter name.
mixed   $value   A default value.

[ Top ]

method getParameterNames [line 324]

array getParameterNames( )

Retrieve an indexed array of user submitted parameter names.



Tags:

return:  An array of parameter names.
since:  1.0
access:  public


[ Top ]

method getParameters [line 339]

array &getParameters( )

Retrieve an associative array of user submitted parameters.



Tags:

return:  An array of parameters.
since:  1.0
access:  public


[ Top ]

method hasAttribute [line 357]

bool hasAttribute( string $name)

Determine if an attribute exists.



Tags:

return:  TRUE, if the given attribute exists, otherwise FALSE.
since:  1.0
access:  public


Parameters:

string   $name   An attribute name.

[ Top ]

method hasCookie [line 375]

bool hasCookie( string $name)

Determine if a cookie exists.



Tags:

return:  TRUE, if the given cookie exists, otherwise FALSE.
since:  1.0
access:  public


Parameters:

string   $name   A cookie name.

[ Top ]

method hasError [line 395]

bool hasError( string $name)

Determine if an error has been set.



Tags:

return:  TRUE, if an error has been set for the given key, otherwise FALSE.
since:  1.0
access:  public


Parameters:

string   $name   The name under which the message has been registered. If the error is validation related, it will be registered under a parameter name.

[ Top ]

method hasErrors [line 411]

bool hasErrors( )

Determine if any error has been set.



Tags:

return:  TRUE, if any error has been set, otherwise FALSE.
since:  2.0
access:  public


[ Top ]

method hasParameter [line 429]

bool hasParameter( string $name)

Determine if the request has a parameter.



Tags:

return:  TRUE, if the given parameter exists, otherwise FALSE.
since:  1.0
access:  public


Parameters:

string   $name   A parameter name.

[ Top ]

method removeAttribute [line 447]

mixed &removeAttribute( string $name)

Remove an attribute.



Tags:

return:  An attribute value, if the given attribute exists and has been removed, otherwise NULL.
since:  1.0
access:  public


Parameters:

string   $name   An attribute name.

[ Top ]

method removeParameter [line 474]

mixed &removeParameter( string $name)

Remove a parameter.



Tags:

return:  A parameter value, if the given parameter exists and has been removed, otherwise NULL.
since:  1.0
access:  public


Parameters:

string   $name   A parameter name.

[ Top ]

method setAttribute [line 499]

void setAttribute( string $name, mixed $value)

Set an attribute.



Tags:

since:  1.0
access:  public


Parameters:

string   $name   An attribute name.
mixed   $value   An attribute value.

[ Top ]

method setAttributeByRef [line 515]

void setAttributeByRef( string $name, mixed &$value)

Set an attribute by reference.



Tags:

since:  1.0
access:  public


Parameters:

string   $name   An attribute name.
mixed   &$value   An attribute value.

[ Top ]

method setError [line 531]

void setError( string $name, string $message)

Set an error message.



Tags:

since:  1.0
access:  public


Parameters:

string   $name   The name under which the message will be registered.
string   $message   An error message.

[ Top ]

method setErrors [line 546]

void setErrors( array $errors)

Set multiple error messages.



Tags:

since:  2.0
access:  public


Parameters:

array   $errors   An associative array of error messages.

[ Top ]

method setMethod [line 574]

void setMethod( int $method)

Set the request method.



Tags:

since:  2.0
access:  public


Parameters:

int   $method  

A request method that is one of the following:

  • REQ_GET - serve GET requests
  • REQ_POST - serve POST requests


[ Top ]

method setParameter [line 590]

void setParameter( string $name, mixed $value)

Manually set a parameter.



Tags:

since:  1.0
access:  public


Parameters:

string   $name   A parameter name.
mixed   $value   A parameter value.

[ Top ]

method setParameterByRef [line 606]

void setParameterByRef( string $name, mixed &$value)

Manually set a parameter by reference.



Tags:

since:  1.0
access:  public


Parameters:

string   $name   A parameter name.
mixed   &$value   A parameter value.

[ Top ]


Documentation generated on Wed, 15 Jun 2005 11:43:42 +0900 by phpDocumentor 1.2.3