ContactMerger extends EntityMerger
Table of Contents
Constants
- ROLE_SEED = 1
- ROLE_TARG = 2
- ROLE_UNDEFINED = 0
Methods
- __construct() : mixed
- create() : EntityMerger
- Create new entity merger by specified entity type ID.
- enabledPermissionCheck() : void
- Enable or disable permission check flag.
- enrich() : mixed
- Enrich destination entity with source entity.
- getConflictResolutionMode() : mixed
- getDefaultConflictResolutionMode() : mixed
- getEntityTypeID() : int
- Get entity type ID.
- getEntityTypeName() : string
- Get entity type name.
- getMap() : mixed
- getMergeCollisions() : mixed
- Get possible merge collisions.
- getUserID() : int
- Get user ID.
- getUserName() : string
- Get user name.
- isAdminUser() : bool
- Check if user is admin.
- isAutomatic() : bool
- isMergable() : bool
- Check if entity can be merged.
- isPermissionCheckEnabled() : bool
- Check if permission check is enabled.
- isRoleDefined() : bool
- Check if role ID id defined.
- merge() : void
- Merge entities.
- mergeBatch() : mixed
- mergeEntityBindings() : mixed
- mergeFields() : void
- Merge fields. If value is absent in target field it will be copied from seed field.
- mergeMultiFields() : void
- Merge multi fields.
- prepareEntityFieldMergeData() : mixed
- prepareEntityMergeData() : mixed
- registerCriterionMismatch() : void
- Register mismatch in duplicate index.
- setConflictResolutionMode() : mixed
- setIsAutomatic() : void
- setMap() : mixed
- setUserID() : void
- Set user ID.
Constants
ROLE_SEED
public
mixed
ROLE_SEED
= 1
ROLE_TARG
public
mixed
ROLE_TARG
= 2
ROLE_UNDEFINED
public
mixed
ROLE_UNDEFINED
= 0
Methods
__construct()
public
__construct(mixed $userID[, mixed $enablePermissionCheck = false ]) : mixed
Parameters
- $userID : mixed
-
User ID.
- $enablePermissionCheck : mixed = false
-
Permission check flag.
create()
Create new entity merger by specified entity type ID.
public
static create(int $entityTypeID, int $currentUserID[, bool $enablePermissionCheck = false ]) : EntityMerger
Parameters
- $entityTypeID : int
-
Entity type ID.
- $currentUserID : int
-
User ID.
- $enablePermissionCheck : bool = false
-
Permission check flag.
Tags
Return values
EntityMergerenabledPermissionCheck()
Enable or disable permission check flag.
public
enabledPermissionCheck(bool $enable) : void
Parameters
- $enable : bool
-
Enable permission check flag.
enrich()
Enrich destination entity with source entity.
public
enrich(EntityMerger $sourceMerger, int $sourceID, int $destinationID) : mixed
Source and Destination entities may have different types. Type of the source entity is determined by Source Instance. Type of the destination entity is determined by this instance.
Parameters
- $sourceMerger : EntityMerger
-
Source Instance.
- $sourceID : int
-
Source Entity ID.
- $destinationID : int
-
Destination Entity ID.
Tags
getConflictResolutionMode()
public
getConflictResolutionMode() : mixed
getDefaultConflictResolutionMode()
public
static getDefaultConflictResolutionMode() : mixed
getEntityTypeID()
Get entity type ID.
public
getEntityTypeID() : int
Return values
intgetEntityTypeName()
Get entity type name.
public
getEntityTypeName() : string
Return values
stringgetMap()
public
getMap() : mixed
getMergeCollisions()
Get possible merge collisions.
public
getMergeCollisions(int $seedID, int $targID) : mixed
Parameters
- $seedID : int
-
Seed entity ID.
- $targID : int
-
Target entity ID.
getUserID()
Get user ID.
public
getUserID() : int
Return values
intgetUserName()
Get user name.
public
getUserName() : string
Return values
stringisAdminUser()
Check if user is admin.
public
isAdminUser() : bool
Return values
boolisAutomatic()
public
isAutomatic() : bool
Return values
boolisMergable()
Check if entity can be merged.
public
isMergable(int $entityID, int $roleID) : bool
Parameters
- $entityID : int
-
Entity ID.
- $roleID : int
-
Role ID.
Tags
Return values
boolisPermissionCheckEnabled()
Check if permission check is enabled.
public
isPermissionCheckEnabled() : bool
Return values
boolisRoleDefined()
Check if role ID id defined.
public
static isRoleDefined(int $roleID) : bool
Parameters
- $roleID : int
-
Role ID.
Return values
boolmerge()
Merge entities.
public
merge(int $seedID, int $targID, DuplicateCriterion $targCriterion) : void
Parameters
- $seedID : int
-
Seed entity ID.
- $targID : int
-
Target entity ID.
- $targCriterion : DuplicateCriterion
-
Criterion.
Tags
mergeBatch()
public
mergeBatch(array<string|int, mixed> $seedIDs, mixed $targID[, DuplicateCriterion $targCriterion = null ]) : mixed
Parameters
- $seedIDs : array<string|int, mixed>
- $targID : mixed
- $targCriterion : DuplicateCriterion = null
mergeEntityBindings()
public
static mergeEntityBindings(mixed $entityTypeID, array<string|int, mixed> &$seedBindings, array<string|int, mixed> &$targBindings) : mixed
Parameters
- $entityTypeID : mixed
- $seedBindings : array<string|int, mixed>
- $targBindings : array<string|int, mixed>
mergeFields()
Merge fields. If value is absent in target field it will be copied from seed field.
public
mergeFields(array<string|int, mixed> &$seed, array<string|int, mixed> &$targ[, bool $skipEmpty = false ][, array<string|int, mixed> $options = array() ]) : void
Parameters
- $seed : array<string|int, mixed>
-
Seed entity fields.
- $targ : array<string|int, mixed>
-
Target entity fields.
- $skipEmpty : bool = false
-
Skip empty fields flag. If is enabled then empty fields of "seed" will not be replaced by fields from "targ"
- $options : array<string|int, mixed> = array()
-
Options array.
mergeMultiFields()
Merge multi fields.
public
static mergeMultiFields(array<string|int, mixed> &$seed, array<string|int, mixed> &$targ[, bool $skipEmpty = false ][, array<string|int, mixed> $options = array() ]) : void
Parameters
- $seed : array<string|int, mixed>
-
Seed entity fields.
- $targ : array<string|int, mixed>
-
Target entity fields.
- $skipEmpty : bool = false
-
Skip empty fields flag. If is enabled then empty fields of "seed" will not be replaced by fields from "targ"
- $options : array<string|int, mixed> = array()
prepareEntityFieldMergeData()
public
prepareEntityFieldMergeData(mixed $fieldID, array<string|int, mixed> $seedIDs, mixed $targID[, array<string|int, mixed> $options = null ]) : mixed
Parameters
- $fieldID : mixed
- $seedIDs : array<string|int, mixed>
- $targID : mixed
- $options : array<string|int, mixed> = null
prepareEntityMergeData()
public
prepareEntityMergeData(array<string|int, mixed> $seedIDs, mixed $targID) : mixed
Parameters
- $seedIDs : array<string|int, mixed>
- $targID : mixed
registerCriterionMismatch()
Register mismatch in duplicate index.
public
registerCriterionMismatch(DuplicateCriterion $criterion, int $leftEntityID, int $rightEntityID) : void
Parameters
- $criterion : DuplicateCriterion
-
Creterion.
- $leftEntityID : int
-
Left entity ID.
- $rightEntityID : int
-
Right entity ID.
Tags
setConflictResolutionMode()
public
setConflictResolutionMode(mixed $mode) : mixed
Parameters
- $mode : mixed
setIsAutomatic()
public
setIsAutomatic(bool $isAutomatic) : void
Parameters
- $isAutomatic : bool
setMap()
public
setMap(array<string|int, mixed> $map) : mixed
Parameters
- $map : array<string|int, mixed>
setUserID()
Set user ID.
public
setUserID(int $userID) : void
Parameters
- $userID : int
-
User ID.