Bitrix API

FactoryBasedMerger 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.
getFieldCaption()  : string
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

Methods

__construct()

public __construct(mixed $entityTypeID, mixed $userID[, mixed $enablePermissionCheck = false ]) : mixed
Parameters
$entityTypeID : mixed

Entity Type ID.

$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
static
Return values
EntityMerger

enabledPermissionCheck()

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
throws
NotImplementedException

getConflictResolutionMode()

public getConflictResolutionMode() : mixed

getDefaultConflictResolutionMode()

public static getDefaultConflictResolutionMode() : mixed

getEntityTypeID()

Get entity type ID.

public getEntityTypeID() : int
Return values
int

getEntityTypeName()

Get entity type name.

public getEntityTypeName() : string
Return values
string

getFieldCaption()

public getFieldCaption(string $fieldId) : string
Parameters
$fieldId : string
Return values
string

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
int

getUserName()

Get user name.

public getUserName() : string
Return values
string

isAdminUser()

Check if user is admin.

public isAdminUser() : bool
Return values
bool

isAutomatic()

public isAutomatic() : bool
Return values
bool

isMergable()

Check if entity can be merged.

public isMergable(int $entityID, int $roleID) : bool
Parameters
$entityID : int

Entity ID.

$roleID : int

Role ID.

Tags
throws
ArgumentException
Return values
bool

isPermissionCheckEnabled()

Check if permission check is enabled.

public isPermissionCheckEnabled() : bool
Return values
bool

isRoleDefined()

Check if role ID id defined.

public static isRoleDefined(int $roleID) : bool
Parameters
$roleID : int

Role ID.

Return values
bool

merge()

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
throws
EntityMergerException
throws
ArgumentException
throws
LoaderException
throws
NotImplementedException

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
throws
ArgumentException

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.


        
On this page

Search results