RequiredAttributesValidViewUtil Class Reference

Static Public Member Functions

static setAsMissingRequiredAttributes ($moduleClassName, $viewClassName)
static removeAttributeAsMissingRequiredAttribute ($moduleClassName, $viewClassName)
static setAsContainingRequiredAttributes ($moduleClassName, $viewClassName)
static isViewMissingRequiredAttributes ($moduleClassName, $viewClassName)
static resolveValidView ($moduleClassName, $viewClassName)
static resolveToSetAsMissingRequiredAttributesByModelClassName ($modelClassName, $attributeName)
static resolveToRemoveAttributeAsMissingRequiredAttribute ($modelClassName, $attributeName)

Detailed Description

Helper class for working with views and making sure a view has the required attributes placed before allowing a user to work with a view in the user interface. When a custom attribute is created, certain views, based on designer rules, are marked as missing required attributes. Once these required attributes are placed, the view is marked as containing the required attributes. The default controller actions such as edit and create resolve this information and display an error page if a view is missing required attributes.

Additional Documentation: Lets say you have a model Account. The name attribute is required on the account. This means that the edit form for an account needs to have the name attribute present, otherwise the user will click 'save' and an exception will be thrown because the name attribute is not present. The goal of RequiredAttributesValidViewUtil to provide a way to analyze in real-time if a attribute is missing from a layout that requires all required attributes. Search view for example, does not require all required attributes but the Edit view for example does. The designer rules are a way of providing rules and information for certain types of views. When you call resolveToSetAsMissingRequiredAttributesByModelClassName, it will check to see if any views require all require attributes by inspecting the designer rules for all the views that are associated with the suppliled model name. If any of the views require all require attributes, it will check to see if the attributeName specified is in fact already on the view or not. Then it takes appropriate action.

Definition at line 56 of file RequiredAttributesValidViewUtil.php.


Member Function Documentation

static setAsMissingRequiredAttributes ( moduleClassName,
viewClassName 
) [static]
Parameters:
String $moduleClassName
String $viewClassName
Exceptions:
NotSupportedException 

Definition at line 63 of file RequiredAttributesValidViewUtil.php.

static removeAttributeAsMissingRequiredAttribute ( moduleClassName,
viewClassName 
) [static]
Parameters:
String $moduleClassName
String $viewClassName
Exceptions:
NotSupportedException 

Definition at line 90 of file RequiredAttributesValidViewUtil.php.

static setAsContainingRequiredAttributes ( moduleClassName,
viewClassName 
) [static]
Parameters:
String $moduleClassName
String $viewClassName

Definition at line 123 of file RequiredAttributesValidViewUtil.php.

static isViewMissingRequiredAttributes ( moduleClassName,
viewClassName 
) [static]
Parameters:
String $moduleClassName
String $viewClassName
Returns:
bool

Definition at line 136 of file RequiredAttributesValidViewUtil.php.

static resolveValidView ( moduleClassName,
viewClassName 
) [static]
Parameters:
String $moduleClassName
String $viewClassName
Returns:
string

Definition at line 154 of file RequiredAttributesValidViewUtil.php.

static resolveToSetAsMissingRequiredAttributesByModelClassName ( modelClassName,
attributeName 
) [static]
Parameters:
string $modelClassName
string $attributeName

Definition at line 174 of file RequiredAttributesValidViewUtil.php.

static resolveToRemoveAttributeAsMissingRequiredAttribute ( modelClassName,
attributeName 
) [static]
Parameters:
string $modelClassName
string $attributeName

Definition at line 219 of file RequiredAttributesValidViewUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Jun 28 07:10:29 2017