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

Class: Validator

Source Location: /Validator.class.php

Class Overview


Validator is a guaranteed way to make sure user submitted parameters are valid. Validator can also modify values, providing a parameter filter system.


Author(s):

  • Sean Kerr

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 20]
Validator is a guaranteed way to make sure user submitted parameters are valid. Validator can also modify values, providing a parameter filter system.



Tags:

since:  1.0
author:  Sean Kerr


[ Top ]


Class Variables

$params =

[line 39]

An associative array of initialization parameters.



Tags:

since:  2.0
access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor Validator [line 47]

Validator &Validator( )

Create a new Validator instance.



Tags:

since:  1.0
access:  public


[ Top ]

method execute [line 76]

bool execute( string &$value, string &$error, Controller &$controller, Request &$request, User &$user)

Execute the validator.



<note> This method should never be called manually. </note>




Tags:

return:  TRUE, if the validator completes successfully, otherwise FALSE.
since:  1.0
access:  public


Parameters:

string   &$value   A parameter value.
string   &$error   An error message to be set, if an error occurs.
Controller   &$controller   A Controller instance.
Request   &$request   A Request instance.
User   &$user   A User instance.

[ Top ]

method getErrorMessage [line 103]

string getErrorMessage( )

Retrieve the default error message.



<note> This will return NULL unless an error message has been specified with setErrorMessage(). </note>




Tags:

return:  An error message.
since:  2.0
access:  public


[ Top ]

method getParameter [line 118]

mixed &getParameter( string $name)

Retrieve a parameter.



Tags:

return:  A parameter value, if the given parameter exists, otherwise NULL.


Parameters:

string   $name   A parameter name.

[ Top ]

method initialize [line 140]

void initialize( array $params)

Initialize the validator.



Tags:

since:  1.0
access:  public


Parameters:

array   $params   An associative array of initialization parameters.

[ Top ]

method setErrorMessage [line 155]

string setErrorMessage( mixed $message)

Set the default error message for any occuring error.



Tags:

return:  An error message.
since:  2.0
access:  public


[ Top ]

method setParameter [line 171]

void setParameter( string $name, mixed $value)

Set a validator parameter.



Tags:

since:  2.0
access:  public


Parameters:

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

[ Top ]

method setParameterByRef [line 187]

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

Set a validator parameter by reference.



Tags:

since:  2.0
access:  public


Parameters:

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

[ Top ]


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