onPHP

Form Class Reference

 

Form Class Reference
[Data validation layerClasses implemented in PHP's extension.]

Complete Form class. More...

Inheritance diagram for Form:

List of all members.

Public Member Functions

 getErrors ()
 getInnerErrors ()
 dropAllErrors ()
 enableImportFiltering ()
 disableImportFiltering ()
 getTextualErrors ()
 Returns plain list of error's labels.
 getTextualErrorFor ($name)
 getErrorDescriptionFor ($name)
 addErrorDescription ($name, $errorType, $description)
 addWrongLabel ($primitiveName, $label)
 addMissingLabel ($primitiveName, $label)
 addCustomLabel ($primitiveName, $customMark, $label)
 import ($scope)
 importMore ($scope)
 importOne ($primitiveName, $scope)
 importValue ($primitiveName, $value)
 importOneMore ($primitiveName, $scope)
 exportValue ($primitiveName)
 export ()
 toFormValue ($value)
 setProto (EntityProto $proto)
 getProto ()
 markMissing ($primitiveName)
 primitive marking
 markWrong ($name)
 rule or primitive
 markGood ($primitiveName)
 markCustom ($primitiveName, $customMark)
 Set's custom error mark for primitive.

Static Public Member Functions

static create ()

Public Attributes

const WRONG = 0x0001
const MISSING = 0x0002

Private Member Functions

 importPrimitive ($scope, BasePrimitive $prm)
 checkImportResult (BasePrimitive $prm, $result)
 addErrorLabel ($name, $errorType, $label)
 Assigns specific label for given primitive and error type.

Private Attributes

 $errors = array()
 $labels = array()
 $describedLabels = array()
 $proto = null
 $importFiltering = true


Detailed Description

Complete Form class.

See also:
http://onphp.org/examples.Form.en.html

Definition at line 21 of file Form.class.php.


Member Function Documentation

Form::addCustomLabel ( primitiveName,
customMark,
label 
)

Returns:
Form

Definition at line 257 of file Form.class.php.

References addErrorLabel().

Here is the call graph for this function:

Form::addErrorDescription ( name,
errorType,
description 
)

Returns:
Form

Definition at line 222 of file Form.class.php.

Form::addErrorLabel ( name,
errorType,
label 
) [private]

Assigns specific label for given primitive and error type.

One more example of horrible documentation style.

Parameters:
$name string primitive or rule name
$errorType enum Form::(WRONG|MISSING)
$label string YDFB WTF is this :-) (c) /.
Exceptions:
MissingElementException 
Returns:
Form

Definition at line 434 of file Form.class.php.

Referenced by addCustomLabel(), addMissingLabel(), and addWrongLabel().

Form::addMissingLabel ( primitiveName,
label 
)

Returns:
Form

Definition at line 249 of file Form.class.php.

References addErrorLabel(), and MISSING.

Here is the call graph for this function:

Form::addWrongLabel ( primitiveName,
label 
)

Returns:
Form

Definition at line 241 of file Form.class.php.

References addErrorLabel(), and WRONG.

Here is the call graph for this function:

Form::checkImportResult ( BasePrimitive prm,
result 
) [private]

Returns:
Form

Definition at line 397 of file Form.class.php.

References BasePrimitive::getCustomError(), BasePrimitive::getName(), BasePrimitive::isRequired(), and markGood().

Referenced by importPrimitive(), and importValue().

Here is the call graph for this function:

static Form::create (  )  [static]

Form::disableImportFiltering (  ) 

Returns:
Form

Definition at line 94 of file Form.class.php.

Form::dropAllErrors (  ) 

Returns:
Form

Definition at line 73 of file Form.class.php.

Form::enableImportFiltering (  ) 

Returns:
Form

Definition at line 84 of file Form.class.php.

Form::export (  ) 

Definition at line 322 of file Form.class.php.

Form::exportValue ( primitiveName  ) 

Definition at line 317 of file Form.class.php.

Form::getErrorDescriptionFor ( name  ) 

Definition at line 199 of file Form.class.php.

Form::getErrors (  ) 

Definition at line 42 of file Form.class.php.

Referenced by getInnerErrors(), SaveCommand::run(), and MakeCommand::run().

Form::getInnerErrors (  ) 

Definition at line 47 of file Form.class.php.

References $errors, and getErrors().

Here is the call graph for this function:

Form::getProto (  ) 

Returns:
EntityProto

Definition at line 357 of file Form.class.php.

Form::getTextualErrorFor ( name  ) 

Definition at line 179 of file Form.class.php.

Referenced by getTextualErrors().

Form::getTextualErrors (  ) 

Returns plain list of error's labels.

Definition at line 167 of file Form.class.php.

References getTextualErrorFor().

Here is the call graph for this function:

Form::import ( scope  ) 

Returns:
Form

Definition at line 265 of file Form.class.php.

References importPrimitive().

Here is the call graph for this function:

Form::importMore ( scope  ) 

Returns:
Form

Definition at line 276 of file Form.class.php.

References importPrimitive().

Here is the call graph for this function:

Form::importOne ( primitiveName,
scope 
)

Returns:
Form

Definition at line 289 of file Form.class.php.

References importPrimitive().

Here is the call graph for this function:

Form::importOneMore ( primitiveName,
scope 
)

Returns:
Form

Definition at line 307 of file Form.class.php.

References importPrimitive().

Here is the call graph for this function:

Form::importPrimitive ( scope,
BasePrimitive prm 
) [private]

Returns:
Form

Definition at line 365 of file Form.class.php.

References checkImportResult(), and BasePrimitive::import().

Referenced by import(), importMore(), importOne(), and importOneMore().

Here is the call graph for this function:

Form::importValue ( primitiveName,
value 
)

Returns:
Form

Definition at line 297 of file Form.class.php.

References checkImportResult().

Referenced by AbstractProtoClass::importPrimitive(), and FormUtils::object2form().

Here is the call graph for this function:

Form::markCustom ( primitiveName,
customMark 
)

Set's custom error mark for primitive.

Returns:
Form

Definition at line 154 of file Form.class.php.

References Assert::isInteger().

Referenced by markMissing().

Here is the call graph for this function:

Form::markGood ( primitiveName  ) 

Returns:
Form

Definition at line 135 of file Form.class.php.

Referenced by checkImportResult(), and MakeCommand::run().

Form::markMissing ( primitiveName  ) 

primitive marking

Returns:
Form

Definition at line 108 of file Form.class.php.

References markCustom(), and MISSING.

Referenced by DropCommand::run().

Here is the call graph for this function:

Form::markWrong ( name  ) 

rule or primitive

Returns:
Form

Definition at line 118 of file Form.class.php.

Form::setProto ( EntityProto proto  ) 

Returns:
Form

Definition at line 347 of file Form.class.php.

Form::toFormValue ( value  ) 


Member Data Documentation

Form::$describedLabels = array() [private]

Definition at line 28 of file Form.class.php.

Form::$errors = array() [private]

Definition at line 26 of file Form.class.php.

Referenced by getInnerErrors().

Form::$importFiltering = true [private]

Definition at line 32 of file Form.class.php.

Form::$labels = array() [private]

Definition at line 27 of file Form.class.php.

Form::$proto = null [private]

Definition at line 30 of file Form.class.php.

const Form::MISSING = 0x0002

Definition at line 24 of file Form.class.php.

Referenced by addMissingLabel(), and markMissing().

const Form::WRONG = 0x0001

Definition at line 23 of file Form.class.php.

Referenced by addWrongLabel(), and RegulatedForm::checkRules().


The documentation for this class was generated from the following file:

generated by doxygen-1.5.7.1
for onPHP at Wed Dec 31 19:42:49 2008