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

Class: Request

Source Location: /request/Request.class.php

Class Overview

ParameterHolder
   |
   --Request

Request provides methods for manipulating client request information such as attributes, errors and parameters. It is also possible to manipulate the request method originally sent by the user.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: Request.class.php 640 2004-12-10 14:10:30Z seank $

Copyright:

Variables

Constants

Methods


Child classes:

ConsoleRequest
WebRequest
WebRequest provides additional support for web-only client requests such as cookie and file manipulation.

Inherited Variables

Inherited Methods

Class: ParameterHolder

ParameterHolder::clearParameters()
Clear all parameters associated with this request.
ParameterHolder::getParameter()
Retrieve a parameter.
ParameterHolder::getParameterNames()
Retrieve an array of parameter names.
ParameterHolder::getParameters()
Retrieve an array of parameters.
ParameterHolder::hasParameter()
Indicates whether or not a parameter exists.
ParameterHolder::removeParameter()
Remove a parameter.
ParameterHolder::setParameter()
Set a parameter.
ParameterHolder::setParameterByRef()
Set a parameter by reference.
ParameterHolder::setParameters()
Set an array of parameters.
ParameterHolder::setParametersByRef()
Set an array of parameters by reference.

Class Details

[line 25]
Request provides methods for manipulating client request information such as attributes, errors and parameters. It is also possible to manipulate the request method originally sent by the user.



Tags:

abstract:  
version:  $Id: Request.class.php 640 2004-12-10 14:10:30Z seank $
since:  1.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Variables

$errors = array()

[line 59]


Type:   mixed


[ Top ]

$method =

[line 60]


Type:   mixed


[ Top ]



Class Methods


method clearAttributes [line 74]

void clearAttributes( )

Clear all attributes associated with this request.



Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method extractParameters [line 96]

array &extractParameters( array $names)

Extract parameter values from the request.



Tags:

return:  An associative array of parameters and their values. If a specified parameter doesn't exist an empty string will be returned for its value.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   $names   An indexed array of parameter names to extract.

[ Top ]

method getAttribute [line 130]

mixed &getAttribute( string $name)

Retrieve an attribute.



Tags:

return:  An attribute value, if the attribute exists, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.

[ Top ]

method getAttributeNames [line 156]

array getAttributeNames( )

Retrieve an array of attribute names.



Tags:

return:  An indexed array of attribute names.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getError [line 175]

string getError( string $name)

Retrieve an error message.



Tags:

return:  An error message, if the error exists, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An error name.

[ Top ]

method getErrorNames [line 201]

array getErrorNames( )

Retrieve an array of error names.



Tags:

return:  An indexed array of error names.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getErrors [line 218]

array getErrors( )

Retrieve an array of errors.



Tags:

return:  An associative array of errors.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getMethod [line 237]

int getMethod( )

Retrieve this request's method.



Tags:

return:  One of the following constants:
  • Request::GET
  • Request::POST
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method hasAttribute [line 256]

bool hasAttribute( string $name)

Indicates whether or not an attribute exists.



Tags:

return:  true, if the attribute exists, otherwise false.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.

[ Top ]

method hasError [line 275]

bool hasError( string $name)

Indicates whether or not an error exists.



Tags:

return:  true, if the error exists, otherwise false.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An error name.

[ Top ]

method hasErrors [line 293]

bool hasErrors( )

Indicates whether or not any errors exist.



Tags:

return:  true, if any error exist, otherwise false.
access:  public
since:  2.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method initialize [line 317]

bool initialize( Context $context, [array $parameters = null])

Initialize this Request.



Tags:

return:  true, if initialization completes successfully, otherwise false.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  InitializationException If an error occurs while initializing this Request.


Overridden in child classes as:

ConsoleRequest::initialize()
Initialize this Request.
WebRequest::initialize()
Initialize this Request.

Parameters:

Context   $context   A Context instance.
array   $parameters   An associative array of initialization parameters.

[ Top ]

method newInstance [line 334]

Request newInstance( string $class)

Retrieve a new Request implementation instance.



Tags:

return:  A Request implementation instance.
static:  
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  FactoryException If a request implementation instance cannot be created.


Parameters:

string   $class   A Request implementation name.

[ Top ]

method removeAttribute [line 368]

mixed &removeAttribute( string $name)

Remove an attribute.



Tags:

return:  An attribute value, if the attribute was removed, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.

[ Top ]

method removeError [line 399]

string &removeError( string $name)

Remove an error.



Tags:

return:  An error message, if the error was removed, otherwise null.
access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An error name.

[ Top ]

method setAttribute [line 433]

void setAttribute( string $name, mixed $value)

Set an attribute.

If an attribute with the name already exists the value will be overridden.




Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

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

[ Top ]

method setAttributeByRef [line 456]

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

Set an attribute by reference.

If an attribute with the name already exists the value will be overridden.




Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $name   An attribute name.
mixed   &$value   A reference to an attribute value.

[ Top ]

method setAttributes [line 479]

void setAttributes( array $attributes)

Set an array of attributes.

If an existing attribute name matches any of the keys in the supplied array, the associated value will be overridden.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   $attributes   An associative array of attributes and their associated values.

[ Top ]

method setAttributesByRef [line 502]

void setAttributesByRef( array &$attributes)

Set an array of attributes by reference.

If an existing attribute name matches any of the keys in the supplied array, the associated value will be overridden.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   &$attributes   An associative array of attributes and references to their associated values.

[ Top ]

method setError [line 527]

void setError( name $name, message $message)

Set an error.



Tags:

access:  public
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

name   $name   An error name.
message   $message   An error message.

[ Top ]

method setErrors [line 551]

void setErrors( array $errors)

Set an array of errors

If an existing error name matches any of the keys in the supplied array, the associated message will be overridden.




Tags:

access:  public
since:  2.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   $errors   An associative array of errors and their associated messages.

[ Top ]

method setMethod [line 575]

void setMethod( int $method)

Set the request method.



Tags:

access:  public
since:  2.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  MojaviException
  • If the specified request method is invalid.


Parameters:

int   $method   One of the following constants:
  • Request::GET
  • Request::POST

[ Top ]

method shutdown [line 605]

void shutdown( )

Execute the shutdown procedure.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

ConsoleRequest::shutdown()
Execute the shutdown procedure.
WebRequest::shutdown()
Execute the shutdown procedure.

[ Top ]


Class Constants

GET =  2

[line 37]

Process validation and execution for only GET requests.



Tags:

since:  3.0.0

[ Top ]

NONE =  1

[line 44]

Skip validation and execution for any request method.



Tags:

since:  3.0.0

[ Top ]

POST =  4

[line 51]

Process validation and execution for only POST requests.



Tags:

since:  3.0.0

[ Top ]



Documentation generated on Tue, 21 Feb 2006 01:45:26 +0900 by phpDocumentor 1.3.0RC5