Class X2MergeableBehavior
Behavior to define the set of methods necessary to merge two or more records into a single record. Should always be implemented on records which have X2DuplicateBehavior but is more general in its application.
- CComponent
- CBehavior implements IBehavior
- CModelBehavior
- CActiveRecordBehavior
- X2MergeableBehavior
public
|
#
setMergedField(
Set the value of $this->owner->{$field->fieldName} to the merged value from the set of duplicates. The value will be set to the value of the duplicate which has a non-null value for this field and the most recent lastUpdated value. |
public
|
#
setMergedCreateDate( array $duplicates )
Set the createDate value of $this->owner to the oldest createDate of the duplicates |
public
|
#
massMergeRelatedRecords( array $duplicates, boolean $logMerge )
Wrapper for mergeRelatedRecords to merge each duplicate into the new record and hide the duplicate. |
public
|
#
mergeRelatedRecords(
Transfers all events, notifications, and actions, tags, relationships, and lookup fields related to the given $model to $this->owner. |
public
|
#
mergeActions(
Transfers all related Actions from $model to $this->owner |
public
|
#
mergeEvents(
Transfers all related Events from $model to $this->owner |
public
|
#
mergeNotifications(
Transfers all related Notifications from $model to $this->owner |
public
|
|
public
|
#
mergeRelationships(
Transfers all relationships of $model to $this->owner |
public
|
#
mergeLinkFields(
Transfers link fields pointing to $model to $htis->owner |
public
|
#
revertMerge( )
Undo a merge based on merge log data stored during the merge process. Should only be called by models which have a corresponding merge log entry. Most helper functions are simpler than their merge counterparts because related records can be transferred between different record types, but actual merges (which are capable of being undone) can only be performed on records of the same type. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
afterDelete(),
afterFind(),
afterSave(),
beforeCount(),
beforeDelete(),
beforeFind(),
beforeSave(),
events()
|
afterConstruct(),
afterValidate(),
beforeValidate()
|
attach(),
detach(),
getEnabled(),
getOwner(),
setEnabled()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
public
array
|
$restrictedFields | array(
'id',
'nameId',
) |
#
Fields which should not be set from old records in a merge. |
$owner
|
$enabled
|