All Data Structures Functions Variables Pages
Static Public Member Functions | Static Protected Member Functions
ModelMetadataUtil Class Reference

Static Public Member Functions

static resolveName ($name)
 
static addOrUpdateMember ($modelClassName, $memberName, $attributeLabels, $defaultValue, $maxLength, $minValue, $maxValue, $precision, $isRequired, $isAudited, $elementType, array $partialTypeRule, array $mixedRule=null)
 
static addOrUpdateRelation ($modelClassName, $relationName, $attributeLabels, $elementType, $isRequired, $isAudited, $relationModelClassName)
 
static addOrUpdateCustomFieldRelation ($modelClassName, $relationName, $attributeLabels, $defaultValue, $isRequired, $isAudited, $elementType, $customFieldDataName, $customFieldDataData=null, $customFieldDataLabels=null, $relationModelClassName= 'OwnedCustomField', $owned=true)
 
static getCastedUpRelationModelClassName ($metadata, $relationName)
 
static removeAttribute ($modelClassName, $attributeName)
 

Static Protected Member Functions

static resolveAddOrRemoveNoAuditInformation ($isAudited, &$modelMetadata, $attributeName)
 
static resolveAttributeLabelsMetadata ($attributeLabels, &$metadata, $modelClassName, $labelsAttributeName)
 

Detailed Description

Helper functionality for use in manipulating model metadata.

Definition at line 40 of file ModelMetadataUtil.php.

Member Function Documentation

static resolveName (   $name)
static
Parameters
$name
Returns
string

Definition at line 46 of file ModelMetadataUtil.php.

static addOrUpdateMember (   $modelClassName,
  $memberName,
  $attributeLabels,
  $defaultValue,
  $maxLength,
  $minValue,
  $maxValue,
  $precision,
  $isRequired,
  $isAudited,
  $elementType,
array  $partialTypeRule,
array  $mixedRule = null 
)
static
Parameters
string$modelClassName
string$memberName
array$attributeLabels
$defaultValue
int$maxLength
int$minValue
int$maxValue
int$precision
bool$isRequired
bool$isAudited
string$elementType
array$partialTypeRule
array$mixedRule

Definition at line 67 of file ModelMetadataUtil.php.

static addOrUpdateRelation (   $modelClassName,
  $relationName,
  $attributeLabels,
  $elementType,
  $isRequired,
  $isAudited,
  $relationModelClassName 
)
static

Updating existing relation attributes and add new has_one relations that are owned only. Currently does not support setting the default value.

Parameters
string$modelClassName
string$relationName
array$attributeLabels
string$elementType
bool$isRequired
bool$isAudited
string$relationModelClassName

Definition at line 122 of file ModelMetadataUtil.php.

static addOrUpdateCustomFieldRelation (   $modelClassName,
  $relationName,
  $attributeLabels,
  $defaultValue,
  $isRequired,
  $isAudited,
  $elementType,
  $customFieldDataName,
  $customFieldDataData = null,
  $customFieldDataLabels = null,
  $relationModelClassName = 'OwnedCustomField',
  $owned = true 
)
static
Parameters
string$modelClassName
string$relationName
array$attributeLabels
$defaultValue
bool$isRequired
bool$isAudited
string$elementType
string$customFieldDataName
null$customFieldDataData
null$customFieldDataLabels
string$relationModelClassName
bool$owned
Exceptions
NotSupportedException

Definition at line 174 of file ModelMetadataUtil.php.

static removeAttribute (   $modelClassName,
  $attributeName 
)
static
Parameters
$modelClassName
$attributeName

Definition at line 435 of file ModelMetadataUtil.php.

static resolveAttributeLabelsMetadata (   $attributeLabels,
$metadata,
  $modelClassName,
  $labelsAttributeName 
)
staticprotected

Given an array of attributeLabels, resolve that array into any existing attributeLabels in the metadata. This is needed in case a language has been inactivated for example, we do not want to lose the translation.

Parameters
array$attributeLabels
array$metadata
string$modelClassName
string$labelsAttributeName

Definition at line 505 of file ModelMetadataUtil.php.


The documentation for this class was generated from the following file:
Generated on Wed Jun 3 2020 07:10:55