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

  • AccountsGridViewProfileWidget
  • ActionMenu
  • ActionsGridViewProfileWidget
  • ActionsQuickCreateRelationshipBehavior
  • ActiveDateRangeInput
  • ApplicationConfigBehavior
  • Attachments
  • ChatBox
  • CommonControllerBehavior
  • ContactMapInlineTags
  • ContactsGridViewProfileWidget
  • CronForm
  • CSaveRelationsBehavior
  • DateRangeInputsWidget
  • DocsGridViewProfileWidget
  • DocViewer
  • DocViewerProfileWidget
  • EButtonColumnWithClearFilters
  • EmailDeliveryBehavior
  • EmailProgressControl
  • EncryptedFieldsBehavior
  • EventsChartProfileWidget
  • FileUploader
  • FontPickerInput
  • Formatter
  • FormView
  • GridViewWidget
  • History
  • IframeWidget
  • ImportExportBehavior
  • InlineActionForm
  • InlineEmailAction
  • InlineEmailForm
  • InlineEmailModelBehavior
  • InlineQuotes
  • JSONEmbeddedModelFieldsBehavior
  • JSONFieldsDefaultValuesBehavior
  • LeadRoutingBehavior
  • LeftWidget
  • LoginThemeHelper
  • LoginThemeHelperBase
  • MarketingGridViewProfileWidget
  • MediaBox
  • MessageBox
  • MobileFormatter
  • MobileFormLayoutRenderer
  • MobileLayoutRenderer
  • MobileLoginThemeHelper
  • MobileViewLayoutRenderer
  • ModelFileUploader
  • NewWebLeadsGridViewProfileWidget
  • NormalizedJSONFieldsBehavior
  • NoteBox
  • OnlineUsers
  • OpportunitiesGridViewProfileWidget
  • Panel
  • ProfileDashboardManager
  • ProfileGridViewWidget
  • ProfileLayoutEditor
  • ProfilesGridViewProfileWidget
  • Publisher
  • PublisherActionTab
  • PublisherCalendarEventTab
  • PublisherCallTab
  • PublisherCommentTab
  • PublisherEventTab
  • PublisherSmallCalendarEventTab
  • PublisherTab
  • PublisherTimeTab
  • QuickContact
  • QuickCreateRelationshipBehavior
  • QuotesGridViewProfileWidget
  • RecordAliasesWidget
  • RecordViewLayoutManager
  • RecordViewWidgetManager
  • RememberPagination
  • Reminders
  • ResponseBehavior
  • ResponsiveHtml
  • SearchIndexBehavior
  • ServicesGridViewProfileWidget
  • SmallCalendar
  • SmartActiveDataProvider
  • SmartDataProviderBehavior
  • SmartSort
  • SocialForm
  • SortableWidgetManager
  • SortableWidgets
  • TagBehavior
  • TagCloud
  • TemplatesGridViewProfileWidget
  • TimeZone
  • TopContacts
  • TopSites
  • TransformedFieldStorageBehavior
  • TranslationLogger
  • TwitterFeed
  • TwoColumnSortableWidgetManager
  • UpdaterBehavior
  • UpdatesForm
  • UserIdentity
  • UsersChartProfileWidget
  • WorkflowBehavior
  • X2ActiveGridView
  • X2ActiveGridViewForSortableWidgets
  • X2AssetManager
  • X2AuthManager
  • X2ChangeLogBehavior
  • X2ClientScript
  • X2Color
  • X2DateUtil
  • X2FixtureManager
  • X2FlowFormatter
  • X2GridView
  • X2GridViewBase
  • X2GridViewForSortableWidgets
  • X2GridViewSortableWidgetsBehavior
  • X2LeadsGridViewProfileWidget
  • X2LinkableBehavior
  • X2ListView
  • X2PillBox
  • X2ProgressBar
  • X2SmartSearchModelBehavior
  • X2TimestampBehavior
  • X2TranslationBehavior
  • X2UrlRule
  • X2WebModule
  • X2Widget
  • X2WidgetList
  • Overview
  • Package
  • Class
  • Tree

Class X2ChangeLogBehavior

Changelog recording behavior class.

X2ChangeLogBehavior is a CActiveRecordBehavior which automatically saves changelog data when a record is saved. It also looks up any applicable notification criteria and takes the appropriate action (create a notification, create a new action, reassign the record, etc.)

CComponent
Extended by CBehavior implements IBehavior
Extended by CModelBehavior
Extended by CActiveRecordBehavior
Extended by X2ChangeLogBehavior
Package: application\components
Located at x2engine/protected/components/X2ChangeLogBehavior.php
Methods summary
public array
# events( )

Declares events and the corresponding event handler methods. If you override this method, make sure you merge the parent result to the return value.

Declares events and the corresponding event handler methods. If you override this method, make sure you merge the parent result to the return value.

Returns

array
events (array keys) and the corresponding event handler methods (array values).

See

CBehavior::events

Overrides

CActiveRecordBehavior::events()
public type
# getEditingUsername( )

Magic getter for editingUsername that returns a username regardless of context.

Magic getter for editingUsername that returns a username regardless of context.

editingUsername should be used in place of Yii::app()->user->name in order for X2Model to work in console commands and API calls (where there is no user session).

Returns

type
public static
# usernameFieldsSet( CActiveRecord $model, mixed $username )

Sets username fields of a model

Sets username fields of a model

public
# beforeSave( CModelEvent $event )

Responds to CActiveRecord::onBeforeSave event. Override this method and make it public if you want to handle the corresponding event of the CBehavior::owner owner. You may set CModelEvent::isValid to be false to quit the saving process.

Responds to CActiveRecord::onBeforeSave event. Override this method and make it public if you want to handle the corresponding event of the CBehavior::owner owner. You may set CModelEvent::isValid to be false to quit the saving process.

Parameters

$event
CModelEvent
$event event parameter

Overrides

CActiveRecordBehavior::beforeSave()
public
# afterCreate( mixed $event )
public
# afterValidate( CEvent $event )

Marks the record as validated, so we know somebody called CActiveRecord::save() rather than CActiveRecord::update() on it

Marks the record as validated, so we know somebody called CActiveRecord::save() rather than CActiveRecord::update() on it

Parameters

$event
CEvent
$event event parameter

Overrides

CModelBehavior::afterValidate()
public
# afterUpdate( mixed $event )

Triggers record_updated, runs changelog calculations and checks notification criteria (soon to be removed)

Triggers record_updated, runs changelog calculations and checks notification criteria (soon to be removed)

public
# afterDelete( CEvent $event )

Logs the deletion of the model

Logs the deletion of the model

Parameters

$event
CEvent
$event event parameter

Overrides

CActiveRecordBehavior::afterDelete()
public array
# getChanges( )

Finds attributes that were changed and generates an array of changes.

Finds attributes that were changed and generates an array of changes.

Returns

array
a 2-dimensional array of changes, with the format $fieldName => array($old,$new)
public
# updateChangelog( array $changes = null )

Writes field changes to the changelog. Calls X2ChangeLogBehavior::checkNotificationCriteria() for each change

Writes field changes to the changelog. Calls X2ChangeLogBehavior::checkNotificationCriteria() for each change

Parameters

$changes
array
$changes the changes array, calls X2ChangeLogBehavior::getChanges() if not provided
public
# checkNotificationCriteria( string $fieldName, string $old, string $new )

Looks up notification criteria in x2_criteria relevant to this model and field and performs the specified operation. Soon to be eliminated in wake of x2flow automation system.

Looks up notification criteria in x2_criteria relevant to this model and field and performs the specified operation. Soon to be eliminated in wake of x2flow automation system.

Parameters

$fieldName
string
$fieldName the name of the current field
$old
string
$old the old value
$new
string
$new the new value
Methods inherited from CActiveRecordBehavior
afterFind(), afterSave(), beforeCount(), beforeDelete(), beforeFind()
Methods inherited from CModelBehavior
afterConstruct(), 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()
Properties summary
public boolean $createEvent true
#
protected boolean $validated false
#
Magic properties summary
public string $autoCompleteSource
#

The action to user for autocomplete data

The action to user for autocomplete data

public string $baseRoute
#

The default module/controller this model "belongs" to

The default module/controller this model "belongs" to

public string $editingUsername
#

Username of the user who is performing the save operation.

Username of the user who is performing the save operation.

public string $viewRoute
#

The default action to view this model

The default action to view this model

Magic properties inherited from CActiveRecordBehavior
$owner
Magic properties inherited from CBehavior
$enabled
X2CRM Documentation API documentation generated by ApiGen 2.8.0