AttributeForm Class Reference

Inheritance diagram for AttributeForm:
ConfigurableMetadataModel AddressAttributeForm CalculatedNumberAttributeForm CheckBoxAttributeForm ContactStateAttributeForm ContactWebFormAttributeForm CurrencyValueAttributeForm DateAttributeForm DateTimeAttributeForm DropDownAttributeForm DropDownDependencyAttributeForm EmailAddressInformationAttributeForm HasOneModelAttributeForm MaxLengthAttributeForm ProductTemplatePriceFrequencyDropDownAttributeForm ProductTemplateStatusDropDownAttributeForm ProductTemplateTypeDropDownAttributeForm ProjectStatusDropDownAttributeForm SellPriceFormulaInformationAttributeForm TaskStatusDropDownAttributeForm TextAreaAttributeForm

Public Member Functions

 __construct (RedBeanModel $model=null, $attributeName=null)
 __toString ()
 rules ()
 attributeLabels ()
 canUpdateAttributeProperty ($propertyName)
 getAttributeTypeName ()
 getModelAttributePartialRule ()
 validateAttributeNameDoesNotExists ()
 validateIsAttributeNameDatabaseReservedWord ()
 validateAttributeDoesNotContainReservedCharacters ()
 validateAttributeLabels ($attribute, $params)
 setModelClassName ($modelClassName)
 getModelClassName ()
 sanitizeFromPostAndSetAttributes ($values)

Static Public Member Functions

static getAttributeTypeDisplayName ()
static getAttributeTypeDisplayDescription ()
static getModelAttributeAdapterNameForSavingAttributeFormData ()

Data Fields

 $attributeName
 $attributeLabels
 $defaultValue = null
 $isAudited = false
 $isRequired = false

Protected Attributes

 $attributePropertyToDesignerFormAdapter
 $modelClassName

Detailed Description

Definition at line 37 of file AttributeForm.php.


Member Function Documentation

getModelAttributePartialRule (  ) 

Returns a partial rule for the attribute being edited by this form. For a rule array('attributeName', 'type', 'type' => 'thetypename'); the method must return array('type', 'type' => 'thetypename') appropriate to its data. For a rule array('attributeName', 'boolean'); the method must return array('boolean'), for example for a checkbox. If the method is not overridden or returns an empty array no rule will be be added to model metadata in regards to the type of the attribute.

Reimplemented in CheckBoxAttributeForm, DateAttributeForm, DateTimeAttributeForm, DecimalAttributeForm, IntegerAttributeForm, PhoneAttributeForm, TextAreaAttributeForm, TextAttributeForm, and UrlAttributeForm.

Definition at line 158 of file AttributeForm.php.

validateAttributeNameDoesNotExists (  ) 

Validates that attribute name does not already exist on model. Ignores check if this is an existing attribute being modified since you can't modify the attribute name except during attribute creation.

Reimplemented in CalculatedNumberAttributeForm, DropDownAttributeForm, and DropDownDependencyAttributeForm.

Definition at line 169 of file AttributeForm.php.

validateIsAttributeNameDatabaseReservedWord (  ) 

Validates that attribute name is not database reserved word.

Definition at line 183 of file AttributeForm.php.

validateAttributeDoesNotContainReservedCharacters (  ) 

Validates that attribute name does not contain reserved character sequences

Definition at line 195 of file AttributeForm.php.

static getModelAttributeAdapterNameForSavingAttributeFormData (  )  [static]

Override if you need to specify a different ModelAttributeAdapterType when saving attributeForm data. This is needed because you can have different logic for calling setting attribute metadata from a form. This allows you to specify an override adapter class.

Returns:
string

Reimplemented in ContactStateAttributeForm, CalculatedNumberAttributeForm, CurrencyValueAttributeForm, DateAttributeForm, DateTimeAttributeForm, DropDownAttributeForm, DropDownDependencyAttributeForm, HasOneModelAttributeForm, and MultiSelectDropDownAttributeForm.

Definition at line 236 of file AttributeForm.php.

sanitizeFromPostAndSetAttributes ( values  ) 

Wrapper method to allow any special sanitization to be done on post data prior to setting the attribute values. Override and extend as needed.

Parameters:
array $values

Reimplemented in DropDownDependencyAttributeForm.

Definition at line 246 of file AttributeForm.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Sep 20 07:10:21 2017