All Data Structures Functions Variables Pages
Static Public Member Functions
ImportRulesUtil Class Reference

Static Public Member Functions

static getImportRulesClassNameByType ($importRulesType)
 
static makeImportRulesByType ($importRulesType)
 
static getImportRulesTypesForCurrentUser ()
 
static areAllRequiredAttributesMappedOrHaveRules (&$requiredAttributeCollection, $mappedAttributeImportRulesCollection)
 
static checkIfAnyAttributesAreDoubleMapped ($mappedAttributeImportRulesCollection)
 

Detailed Description

Helper class for working with ImportRules.

Definition at line 40 of file ImportRulesUtil.php.

Member Function Documentation

static getImportRulesClassNameByType (   $importRulesType)
static
Parameters
string$importRulesType
Returns
string
Exceptions
NotSupportedException

Definition at line 47 of file ImportRulesUtil.php.

static makeImportRulesByType (   $importRulesType)
static
Parameters
string$importRulesType
Returns
mixed

Definition at line 62 of file ImportRulesUtil.php.

static getImportRulesTypesForCurrentUser ( )
static

Based on the current user, return the importRules types and their display labels. Only include import rules that the user has a right to access its corresponding module.

Returns
array of import rules types and display labels.

Definition at line 74 of file ImportRulesUtil.php.

static areAllRequiredAttributesMappedOrHaveRules ( $requiredAttributeCollection,
  $mappedAttributeImportRulesCollection 
)
static

Given a collection of required attributes by attribute indexes and a collection of mapped attribute rules, check if all of the required attributes are mapped.

Parameters
array$requiredAttributeCollection
array$mappedAttributeImportRulesCollection
Exceptions
NotSupportedException- Throws an error if the $mappedAttributeImportRulesCollection contains any attribute rules that are not AttributeImportRules.
Returns
boolean true - all required are mapped, otherwise false.

Definition at line 120 of file ImportRulesUtil.php.

static checkIfAnyAttributesAreDoubleMapped (   $mappedAttributeImportRulesCollection)
static

Given an array of mapped attribute rules, determine if any of the mapped rules overlap in which attributes they map to. This can happen if a derived attribute type contains multiple model attributes. If that derived type is mapped to one column, and one of those individual model attributes is also mapped to a different column, then this is considered an overlap and is not allowed. If this is found an exception is thrown.

Parameters
array$mappedAttributeImportRulesCollection
Exceptions
ImportAttributeMappedMoreThanOnceException
Returns
null;

Definition at line 168 of file ImportRulesUtil.php.


The documentation for this class was generated from the following file:
Generated on Sat Jun 6 2020 07:10:51