Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionFormModel
  • ArrayUtil
  • ArrayValidator
  • AssociatedMediaBehavior
  • AuxLib
  • Changelog
  • DetailView
  • EncryptUtilTmp
  • EventsWidgetFieldFormatter
  • FailedLogins
  • FieldFormatter
  • FieldFormatterBase
  • FieldInputRenderer
  • FileFieldBehavior
  • FiltersForm
  • FilterUtil
  • FineDiff
  • FineDiffCopyOp
  • FineDiffDeleteOp
  • FineDiffInsertOp
  • FineDiffOp
  • FineDiffOps
  • FineDiffReplaceOp
  • GlobalCSSFormModel
  • GlobalImportFormModel
  • GoogleAuthenticator
  • JSONFieldsBehavior
  • JSONResponse
  • MediaFieldFormatter
  • MediaSelector
  • MobileActiveRecordFieldFormatter
  • MobileActivityFeed
  • MobileChartDashboard
  • MobileFieldFormatter
  • MobileFieldInputRenderer
  • ModuleModelNameValidator
  • MultiChildNode
  • MultiTypeAutocomplete
  • PasswordUtil
  • ProductFeature
  • ProfileWidgetLayout
  • QueryParamGenerator
  • RecordLimitBehavior
  • RecordView
  • RecordViewWidgetLayout
  • RelationshipsGridModel
  • RelationshipsJoin
  • RepairUserDataCommand
  • RequestUtil
  • RequiredIfNotSetValidator
  • ResponseUtil
  • RunMigrationScriptCommand
  • ServiceWebFormDesigner
  • Settings
  • StringUtil
  • TestEmailAction
  • TestEmailActionForm
  • ThemeGenerator
  • TimerUtil
  • TopicsFieldFormatter
  • TopicsWidgetLayout
  • TransactionalViewFieldFormatter
  • UrlUtil
  • ValidLinkValidator
  • WebFormDesigner
  • WebLeadFormDesigner
  • X2ActiveRecordBehavior
  • X2ActiveRecordFieldFormatter
  • X2ButtonColumn
  • X2ConditionList
  • X2ConsoleCommand
  • X2ControllerBehavior
  • X2DataColumn
  • X2DuplicateBehavior
  • X2Flashes
  • X2GridViewFieldFormatter
  • X2IPAddress
  • X2LeadsDataColumn
  • X2MergeableBehavior
  • X2MessageSource
  • X2MobileControllerBehavior
  • X2MobileProfileControllerBehavior
  • X2MobileQuotesControllerBehavior
  • X2MobileSiteControllerBehavior
  • X2MobileTopicsControllerBehavior
  • X2ModelConversionBehavior
  • X2ModelConversionWidget
  • X2ModelForeignKeyValidator
  • X2ModelUniqueIndexValidator
  • X2NonWebUser
  • X2StaticDropdown
  • X2StaticField
  • X2StaticFieldsBehavior
  • X2UrlManager
  • X2Validator
  • X2WidgetBehavior

Interfaces

  • AdminOwnedCredentials

Exceptions

  • CampaignMailingException
  • CodeExchangeException
  • GetCredentialsException
  • NoRefreshTokenException
  • NoUserIdException
  • StringUtilException

Functions

  • checkCurrency
  • checkDNS
  • checkServerVar
  • checkTimezone
  • decodeQuotes
  • echoIcons
  • encodeQuotes
  • exceptionForError
  • getField
  • getLanguageName
  • getModuleTitle
  • handleReqError
  • handleReqException
  • installer_t
  • installer_tr
  • isAllowedDir
  • mediaMigrationRrmdir
  • migrateMediaDir
  • printGraph
  • printR
  • renderFields
  • reqShutdown
  • RIP
  • translateOptions
  • tryGetRemote
  • Overview
  • Package
  • Class
  • Tree

Class X2DuplicateBehavior

Behavior to provide requisite methods for checking for potential duplicate records. Currently only implemented in Contacts and Accounts.

CComponent
Extended by CBehavior implements IBehavior
Extended by CModelBehavior
Extended by CActiveRecordBehavior
Extended by X2DuplicateBehavior
Located at x2engine/protected/components/X2DuplicateBehavior.php
Methods summary
public boolean
# checkForDuplicates( )

Returns whether or not any duplicate records exist in the database.

Returns whether or not any duplicate records exist in the database.

Commonly used as a gate in an if statement for other duplicate checking functionality.

Returns

boolean
public CActiveDataProvider
# getDuplicates( boolean $getAll = false, mixed $strict = false )

Return a list of potential duplicate records.

Return a list of potential duplicate records.

Capts at 5 records unless a special parameter is provided so as to prevent possible server crashes from attempting to render large numbers of records.

Parameters

$getAll
boolean
$getAll Whether to return all records or just 5
$strict

Returns

CActiveDataProvider
public integer
# countDuplicates( )

Returns the total number of duplicates found (unrestricted by the limit on getDuplicates)

Returns the total number of duplicates found (unrestricted by the limit on getDuplicates)

Returns

integer
public
# markAsDuplicate( string $action = 'hide' )

Mark a record as a duplicate.

Mark a record as a duplicate.

Set all relevant fields to the proper values for marking a record as duplicate. A duplicate record is private and assigned to 'Anyone', and if there are options for "doNotCall" and "doNotEmail" they need to be turned on. Alternatively, the "delete" string can be passed to delete the record instead of hiding it. This functionality exists in case some future code requires more things to be done on deleting duplicates.

Parameters

$action
string
$action
public
# afterSave( CEvent $event )

Reset dupeCheck field if duplicate defining fields are changed.

Reset dupeCheck field if duplicate defining fields are changed.

Records have a concept of "duplicate-defining fields" which are the fields that are checked when searching for duplicates (name, email, etc.). If one of those fields is changed in an update, the dupeCheck parameter needs to be reset and the record needs to be checked for possible duplicates again.

Parameters

$event
CEvent
$event

Overrides

CActiveRecordBehavior::afterSave()
public
# duplicateChecked( )

Update the dupeCheck field to reflect that a record has been checked.

Update the dupeCheck field to reflect that a record has been checked.

Set the value in the current record and use updateByPk so that no validation or behaviors from afterSave are called.

public
# resetDuplicateField( )

Reset the dupeCheck field to its unchecked state.

Reset the dupeCheck field to its unchecked state.

public
# hideDuplicates( )

Hide all potential duplicate records.

Hide all potential duplicate records.

This is equivalent to a mass version of "markAsDuplicate" but it affects records other than the currenly loaded one.

public
# deleteDuplicates( )

Delete all potential duplicate records.

Delete all potential duplicate records.

Methods inherited from CActiveRecordBehavior
afterDelete(), afterFind(), beforeCount(), beforeDelete(), beforeFind(), beforeSave(), events()
Methods inherited from CModelBehavior
afterConstruct(), afterValidate(), beforeValidate()
Methods inherited from CBehavior
attach(), detach(), getEnabled(), getOwner(), setEnabled()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
string DUPLICATE_FIELD 'dupeCheck'
#
integer DUPLICATE_LIMIT 5
#
Magic properties inherited from CActiveRecordBehavior
$owner
Magic properties inherited from CBehavior
$enabled
X2CRM Documentation API documentation generated by ApiGen 2.8.0