Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

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

Complete Form class. More...

Inheritance diagram for Form:
Inheritance graph
[legend]

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)
 getWrongLabel ($primitiveName)
 getMissingLabel ($primitiveName)
 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.
 getErrorLabel ($name, $errorType)

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 20 of file Form.class.php.


Member Function Documentation

Form::addCustomLabel ( primitiveName,
customMark,
label 
)
Returns:
Form

Definition at line 256 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 221 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 443 of file Form.class.php.

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

Form::addMissingLabel ( primitiveName,
label 
)
Returns:
Form

Definition at line 248 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 240 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 406 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 93 of file Form.class.php.

Form::dropAllErrors (  ) 
Returns:
Form

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

Form::enableImportFiltering (  ) 
Returns:
Form

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

Form::export (  ) 

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

Form::exportValue ( primitiveName  ) 

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

Form::getErrorDescriptionFor ( name  ) 

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

Form::getErrorLabel ( name,
errorType 
) [private]

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

Referenced by getMissingLabel(), and getWrongLabel().

Form::getErrors (  ) 

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

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

Form::getInnerErrors (  ) 

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

References $errors, and getErrors().

Here is the call graph for this function:

Form::getMissingLabel ( primitiveName  ) 

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

References getErrorLabel(), and MISSING.

Here is the call graph for this function:

Form::getProto (  ) 
Returns:
EntityProto

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

Form::getTextualErrorFor ( name  ) 

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

Referenced by getTextualErrors().

Form::getTextualErrors (  ) 

Returns plain list of error's labels.

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

References getTextualErrorFor().

Here is the call graph for this function:

Form::getWrongLabel ( primitiveName  ) 

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

References getErrorLabel(), and WRONG.

Here is the call graph for this function:

Form::import ( scope  ) 
Returns:
Form

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

References importPrimitive().

Here is the call graph for this function:

Form::importMore ( scope  ) 
Returns:
Form

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

References importPrimitive().

Here is the call graph for this function:

Form::importOne ( primitiveName,
scope 
)
Returns:
Form

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

References importPrimitive().

Here is the call graph for this function:

Form::importOneMore ( primitiveName,
scope 
)
Returns:
Form

Definition at line 316 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 374 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 306 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 153 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 134 of file Form.class.php.

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

Form::markMissing ( primitiveName  ) 

primitive marking

Returns:
Form

Definition at line 107 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 117 of file Form.class.php.

Form::setProto ( EntityProto proto  ) 
Returns:
Form

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

Form::toFormValue ( value  ) 

Member Data Documentation

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

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

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

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

Referenced by getInnerErrors().

Form::$importFiltering = true [private]

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

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

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

Form::$proto = null [private]

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

const Form::MISSING = 0x0002

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

Referenced by addMissingLabel(), getMissingLabel(), and markMissing().

const Form::WRONG = 0x0001

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

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


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