ModelForm Class Reference

Inheritance diagram for ModelForm:
ContactWebFormsModelForm CreateEmailMessageForm SearchForm UserAvatarForm UserEmailConfigurationForm UserPasswordForm ContactStateSearchForm CurrenciesSearchForm DynamicSearchForm GroupsSearchForm MarketingListMembersSearchForm RolesSearchForm WorkflownQueuesSearchForm AAASearchFormTestModel ApiTestModelItem2SearchForm ApiTestModelItemSearchForm ASearchFormTestModel CCCSearchFormTestModel IIISearchFormTestModel MixedRelationsModelSearchFormTestModel SavedDynamicSearchForm ByTimeWorkflowInQueuesSearchForm WorkflowMessageInQueuesSearchForm

Public Member Functions

 __construct (RedBeanModel $model)
 getModel ()
 __toString ()
 __set ($name, $value)
 __get ($name)
 getMetadata ()
 isAttribute ($attributeName)
 isAttributeRequired ($attribute)
 attributeNames ()
 getAttributeLabel ($attribute)
 setAttributes ($values, $safeOnly=true)
 validate ($attributes=null, $clearErrors=true)
 getValidators ($attribute=null)
 getErrors ($attributeNameOrNames=null)
 hasErrors ($attributeNameOrNames=null)
 save ($runValidation=true, array $attributeNames=null)

Static Public Member Functions

static isOwnedRelation ($attributeName)
static isRelation ($attributeName)
static getRelationModelClassName ($relationName)

Static Protected Member Functions

static getRedBeanModelClassName ()
static shouldIgnoreRequiredValidator ()

Protected Attributes

 $model

Detailed Description

Provides an interface that is the same as a RedBeanModel interface, but allows developer to extend RedBeanModel with additional attributes that are not part of the model.

Definition at line 42 of file ModelForm.php.


Member Function Documentation

getMetadata (  ) 

Interface to mimic model getMetadata method. Can only be called non-statically since the model is required.

Reimplemented in SearchForm.

Definition at line 97 of file ModelForm.php.

static isOwnedRelation ( attributeName  )  [static]

If the attribute exists on the form, then assume it is not a relation since the form does not support relational attributes.

Definition at line 106 of file ModelForm.php.

static isRelation ( attributeName  )  [static]

If the attribute exists on the form, then assume it is not a relation since the form does not support relational attributes.

Reimplemented in SearchForm.

Definition at line 120 of file ModelForm.php.

static getRelationModelClassName ( relationName  )  [static]

If the attribute exists on the form, then assume it is not a relation since the form does not support relational attributes.

Reimplemented in SearchForm.

Definition at line 134 of file ModelForm.php.

isAttribute ( attributeName  ) 

Returns true if the named attribute is a property on this model.

Reimplemented in SearchForm.

Definition at line 148 of file ModelForm.php.

isAttributeRequired ( attribute  ) 

Override to properly check if the attribute is required or not. (non-PHPdoc)

See also:
CModel::isAttributeRequired()

Reimplemented in SearchForm, and ContactWebFormsModelForm.

Definition at line 164 of file ModelForm.php.

attributeNames (  ) 

Returns the list of attribute names. By default, this method returns all public properties of the class. You may override this method to change the default.

Returns:
array list of attribute names. Defaults to all public properties of the class.

Reimplemented in SearchForm.

Definition at line 179 of file ModelForm.php.

setAttributes ( values,
safeOnly = true 
)

Override of setAttributes in CModel to support setting attributes into this form as well as the related model. Splits $values into two arrays. First array is name/value pairs of attributes on this form, whereas the second array is name/value pairs on the model.

Reimplemented in SearchForm.

Definition at line 219 of file ModelForm.php.

validate ( attributes = null,
clearErrors = true 
)

Performs validation on this form and the model. clearErrors is not supported, because the model does not support this parameter in the RedBeanModel->validate() function. Currently this method does not support specifying the $attributes parameter.

Definition at line 244 of file ModelForm.php.

getValidators ( attribute = null  ) 

Override to properly get validators for an attribute when they are on the model. Todo: Factor in scenario for model attributes. (non-PHPdoc)

See also:
CModel::getValidators()

Definition at line 263 of file ModelForm.php.

static shouldIgnoreRequiredValidator (  )  [static, protected]

Override and set to true if you need to ignore the required validator.

Reimplemented in SearchForm.

Definition at line 275 of file ModelForm.php.

getErrors ( attributeNameOrNames = null  ) 

Return array of errors on form and model. Currently this method does not support specifying the $attributeNameOrNames parameter.

Definition at line 284 of file ModelForm.php.

hasErrors ( attributeNameOrNames = null  ) 
Returns:
true/false. If the form and/or the model has any errors. Currently this method does not support specifying the $attributeNameOrNames parameter.

Definition at line 295 of file ModelForm.php.

save ( runValidation = true,
array $  attributeNames = null 
)

Saves the model.

Reimplemented in UserEmailConfigurationForm.

Definition at line 308 of file ModelForm.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Jul 27 07:10:27 2017