ModelAttributeToOperatorTypeUtil Class Reference

Inheritance diagram for ModelAttributeToOperatorTypeUtil:
ModelAttributeToReportOperatorTypeUtil ModelAttributeToWorkflowOperatorTypeUtil

Static Public Member Functions

static resolveOperatorsToIncludeByType (&$data, $type)
static getOperatorType ($model, $attributeName)
static getAvailableOperatorsType ($model, $attributeName)

Data Fields

const AVAILABLE_OPERATORS_TYPE_BOOLEAN = 'Boolean'
const AVAILABLE_OPERATORS_TYPE_STRING = 'String'
const AVAILABLE_OPERATORS_TYPE_NUMBER = 'Number'
const AVAILABLE_OPERATORS_TYPE_DROPDOWN = 'DropDown'
const AVAILABLE_OPERATORS_TYPE_HAS_ONE = 'HasOne'

Static Protected Member Functions

static resolveIsNullAndIsNotNullOperatorsToInclude (&$data, $type)
static getOperatorTypeFromModelMetadataElement ($element)
static getAvailableOperatorsTypeFromModelMetadataElement ($element)
static getAvailableOperatorsTypeForBoolean ()

Detailed Description

Given a model and its attribute, find the appropriate operator type.

Definition at line 40 of file ModelAttributeToOperatorTypeUtil.php.


Member Function Documentation

static getOperatorType ( model,
attributeName 
) [static]

Returns the operator type that should be used with the named attribute of the given model. If the model is a customField, it assumes some sort of dropdown and returns 'equals'.

Parameters:
$model - instance of a RedBeanModel or RedBeanModels if the model is a HAS_MANY relation on the original model.
string $attributeName
Returns:
string
Exceptions:
NotSupportedException 

Definition at line 121 of file ModelAttributeToOperatorTypeUtil.php.

static getAvailableOperatorsType ( model,
attributeName 
) [static]

Returns the available operators type. A string for example has 'String' as the available operators type. This can than be adapted into a dropDown to display possible operators that can be used with a string.

Parameters:
$model - instance of a RedBeanModel or RedBeanModels if the model is a HAS_MANY relation on the original model.
$attributeName 
Returns:
string representing the type. if no type is available then null is returned.
Exceptions:
NotSupportedException 

Reimplemented in ModelAttributeToWorkflowOperatorTypeUtil.

Definition at line 236 of file ModelAttributeToOperatorTypeUtil.php.


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