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

Class: Validator

Source Location: /validator/Validator.class.php

Class Overview

ParameterHolder
   |
   --Validator

Validator allows you to apply constraints to user entered parameters.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: Validator.class.php 569 2004-12-05 06:25:47Z seank $

Copyright:

Methods


Child classes:

EmailValidator
EmailValidator verifies a parameter contains a value that qualifies as an email address.
StringValidator
StringValidator allows you to apply string-related constraints to a parameter.
NumberValidator
NumberValidator verifies a parameter is a number and allows you to apply size constraints.
RegexValidator
RegexValidator allows you to match a value against a regular expression pattern.
DateValidator
DateValidator verifies a parameter is of a date format.

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 23]
Validator allows you to apply constraints to user entered parameters.



Tags:

abstract:  
version:  $Id: Validator.class.php 569 2004-12-05 06:25:47Z seank $
since:  1.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Methods


method execute [line 49]

bool execute( mixed &$value, string &$error)

Execute this validator.



Tags:

return:  true, if this validator executes successfully, otherwise false.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

EmailValidator::execute()
Execute this validator.
StringValidator::execute()
Execute this validator.
NumberValidator::execute()
Execute this validator.
RegexValidator::execute()
Execute this validator.
DateValidator::execute()
Execute this validator.

Parameters:

mixed   &$value   A file or parameter value/array.
string   &$error   An error message reference.

[ Top ]

method getContext [line 61]

Context getContext( )

Retrieve the current application context.



Tags:

return:  The current Context instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method initialize [line 82]

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

Initialize this validator.



Tags:

return:  true, if initialization completes successfully, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

StringValidator::initialize()
Initialize this validator.
NumberValidator::initialize()
Initialize this validator.
RegexValidator::initialize()
Initialize this validator.

Parameters:

Context   $context   The current application context.
array   $parameters   An associative array of initialization parameters.

[ Top ]


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