Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes
ModelForm Class Reference
Inheritance diagram for ModelForm:
ContactWebFormsModelForm CreateEmailMessageForm SearchForm UserAvatarForm UserEmailConfigurationForm UserPasswordForm UserSendGridConfigurationForm ContactStateSearchForm CurrenciesSearchForm DynamicSearchForm GroupsSearchForm ImagesSearchForm MarketingListMembersSearchForm RolesSearchForm WorkflownQueuesSearchForm

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)
 
 getError ($attribute)
 

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

static getRedBeanModelClassName ( )
staticprotected

Override in child to implement.

Exceptions
NotImplementedException

Definition at line 52 of file ModelForm.php.

getMetadata ( )

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

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.

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.

Definition at line 134 of file ModelForm.php.

isAttribute (   $attributeName)

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

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()

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.

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.

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 ( )
staticprotected

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

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.

Definition at line 308 of file ModelForm.php.

getError (   $attribute)

Override to fix the defect where modelform consist of a model whose attributes are displayed on the form.

See Also
UserConfigurationForm or UserSendGridConfigurationForm
Parameters
string$attributeattribute name.
Returns
string the error message. Null is returned if no error.

Definition at line 324 of file ModelForm.php.


The documentation for this class was generated from the following file:
Generated on Fri Sep 25 2020 07:10:52
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.