phpDocumentor Naos_Form
[ class tree: Naos_Form ] [ index: Naos_Form ] [ all elements ]

Class: Naos_Form

Source Location: /Form.php

Class Naos_Form

Class Overview

Naos_Form represents a formular for data exchange with the user. The class provides access to the values, and gathers the form values autonomously.

Located in /Form.php [line 26]



		
				Author(s):
		
Information Tags:
Copyright:  Copyright (c) 2008 Jupiter GmbH
License:  http://www.naos-framework.com/website.naos.framework/en/license

Methods

[ Top ]
Method Summary
static Naos_Form   form()   This function provides access to the form instances. It implements a singleton pattern on class identifier basis, i.e. only one instance of a form class per class identifier is allowed. The instances are collected in a cache for later access.
void   __construct()   This is the constructor of the form class. It is protected and therefore it is not possible to instantiate the form class directly.
void   addError()   Adds a new eror to an item or to a specific index of an item.
void   applyAdditionalDefinition()  
void   applyDefinition()   Applies the definition of a form to the current stored content. This includes the validation of the text attribute (text attribute filters) as well as the verification of the available attributes per item.
void   clearErrors()  
mixed   getAttribute()   Gets the content of an item value attribute.
array   getErrors1()   Get all available errors
array   getErrors2()   Get errors on item level
array   getErrors3()   Get errors on item index level
array   getPredefinedValues()   Get the set of predefined values for a specific item. This is used especially for select boxes as well as for predefined indices.
string|null   getTitleAttribute()   Gets the title of an item (which is the either read from the configuration or which is in fact the title attribute).
void   hasAttribute()   Checks for the availability of an item value attribute.
boolean   hasErrors()   Returns true when form contains errors. False otherwise.
void   loadFromObject()  
void   prepareAttributes()   This function applies the specific prepare function for an input class and sets the resulting attributes to the item value in question.
void   setAttribute()   Sets the content of an item value attribute.
boolean   stateReceived()   This function indicates if we have a form object with received values or if we have a new form object.
void   storeToObject()  
void   validateTextFilter()   This function performs the validation of the text attribute with the text attribute filter. In case a validation failes the function adds the specific error to the form.
boolean   verifyAttributes()   This function performs the verification of the attributes. In general it checks if requested attributes are available. This is a guarantee for the developer of the business logic that he is able to work with these attributes in any case.
void   _loadFromObject()  
void   _storeToObject()  

[ Top ]
Methods
static method form  [line 38]

  static Naos_Form form( $module, $formId, [ $requireReceived = false]  )

This function provides access to the form instances. It implements a singleton pattern on class identifier basis, i.e. only one instance of a form class per class identifier is allowed. The instances are collected in a cache for later access.

Parameters:
   $module: 
   $formId: 
   $requireReceived: 

API Tags:
Access:  public


[ Top ]
Constructor __construct  [line 79]

  void __construct( $module, $formId  )

This is the constructor of the form class. It is protected and therefore it is not possible to instantiate the form class directly.

The constructor prepares the form object and loads available values from the available data sources. Later on it applies the form definition, which includes the application of Naos_Form_AttributeTextFilter and the generation of error messages.

Parameters:
   $module: 
   $formId: 

API Tags:
See:  Naos_Form:form
Access:  protected


[ Top ]
addError  [line 258]

  void addError( $errorText, $errorParams, $item, [ $index = null]  )

Adds a new eror to an item or to a specific index of an item.

Parameters:
   $errorText: 
   $errorParams: 
   $item: 
   $index: 

API Tags:
Access:  public


[ Top ]
applyAdditionalDefinition  [line 428]

  void applyAdditionalDefinition( $definitionSection  )

Parameters:
   $definitionSection: 

API Tags:
Access:  public


[ Top ]
applyDefinition  [line 395]

  void applyDefinition( $definition  )

Applies the definition of a form to the current stored content. This includes the validation of the text attribute (text attribute filters) as well as the verification of the available attributes per item.

The verification of the available attributes is only applies when the validation of the text attributes succeeds. Therefore you should rely on attributes only if the form has no errors.

Parameters:
   $definition: 

API Tags:
Access:  protected


[ Top ]
clearErrors  [line 331]

  void clearErrors( )


API Tags:
Access:  public


[ Top ]
getAttribute  [line 208]

  mixed getAttribute( $item, [ $index = null], [ $type = 'text']  )

Gets the content of an item value attribute.

Parameters:
   $item: 
   $index: 
   $type: 

API Tags:
Access:  public


[ Top ]
getErrors1  [line 279]

  array getErrors1( )

Get all available errors


API Tags:
Access:  public


[ Top ]
getErrors2  [line 289]

  array getErrors2( $item  )

Get errors on item level

Parameters:
   $item: 

API Tags:
Access:  public


[ Top ]
getErrors3  [line 302]

  array getErrors3( $item, [ $index = null]  )

Get errors on item index level

Parameters:
   $item: 
   $index: 

API Tags:
Access:  public


[ Top ]
getPredefinedValues  [line 342]

  array getPredefinedValues( $item  )

Get the set of predefined values for a specific item. This is used especially for select boxes as well as for predefined indices.

Parameters:
   $item: 

API Tags:
Access:  public


[ Top ]
getTitleAttribute  [line 222]

  string|null getTitleAttribute( $item, [ $index = null]  )

Gets the title of an item (which is the either read from the configuration or which is in fact the title attribute).

Parameters:
   $item: 
   $index: 

API Tags:
Access:  public


[ Top ]
hasAttribute  [line 192]

  void hasAttribute( $item, [ $index = null], [ $type = 'text']  )

Checks for the availability of an item value attribute.

Parameters:
   $item: 
   $index: 
   $type: 

API Tags:
Access:  public


[ Top ]
hasErrors  [line 317]

  boolean hasErrors( )

Returns true when form contains errors. False otherwise.


API Tags:
Access:  public


[ Top ]
loadFromObject  [line 584]

  void loadFromObject( $object, [ $definitionSection = null], [ $ignore = array()]  )

Parameters:
   $object: 
   $definitionSection: 
   $ignore: 

API Tags:
Access:  public


[ Top ]
prepareAttributes  [line 162]

  void prepareAttributes( $item, $index, $inputClass  )

This function applies the specific prepare function for an input class and sets the resulting attributes to the item value in question.

Parameters:
   $item: 
   $index: 
   $inputClass: 

API Tags:
Access:  public


[ Top ]
setAttribute  [line 243]

  void setAttribute( $value, $item, [ $index = null], [ $type = 'text']  )

Sets the content of an item value attribute.

Parameters:
   $value: 
   $item: 
   $index: 
   $type: 

API Tags:
Access:  public


[ Top ]
stateReceived  [line 515]

  boolean stateReceived( )

This function indicates if we have a form object with received values or if we have a new form object.


API Tags:
Access:  public


[ Top ]
storeToObject  [line 562]

  void storeToObject( $object, [ $definitionSection = null], [ $ignore = array()]  )

Parameters:
   $object: 
   $definitionSection: 
   $ignore: 

API Tags:
Access:  public


[ Top ]
validateTextFilter  [line 482]

  void validateTextFilter( $item, $textFilter  )

This function performs the validation of the text attribute with the text attribute filter. In case a validation failes the function adds the specific error to the form.

Parameters:
   $item: 
   $textFilter: 

API Tags:
Access:  protected


[ Top ]
verifyAttributes  [line 453]

  boolean verifyAttributes( $item, $requiredAttributes, [ $throwException = true]  )

This function performs the verification of the attributes. In general it checks if requested attributes are available. This is a guarantee for the developer of the business logic that he is able to work with these attributes in any case.

Parameters:
   $item: 
   $requiredAttributes: 
   $throwException: 

API Tags:
Access:  protected


[ Top ]
_loadFromObject  [line 541]

  void _loadFromObject( $object, $definition, [ $ignore = array()]  )

Parameters:
   $object: 
   $definition: 
   $ignore: 

API Tags:
Access:  protected


[ Top ]
_storeToObject  [line 520]

  void _storeToObject( $object, $definition, [ $ignore = array()]  )

Parameters:
   $object: 
   $definition: 
   $ignore: 

API Tags:
Access:  protected


[ Top ]

Documentation generated on Sat, 13 Sep 2008 01:40:46 -0400 by phpDocumentor 1.4.0