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

  • ActionToRecord
  • ContactsNameBehavior
  • ERememberFiltersBehavior
  • FileSystemObjectBehavior
  • MobileLayouts
  • RecordAliases
  • RelationshipsBehavior
  • TopicReplies
  • X2ActiveRecord
  • X2Flow
  • Overview
  • Package
  • Class
  • Tree

Class X2Flow

CActiveRecord is the base class for classes representing relational data.

It implements the active record design pattern, a popular Object-Relational Mapping (ORM) technique. Please check the Guide for more details about this class.

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CActiveRecord
Extended by X2ActiveRecord
Extended by X2Flow
Package: system\db\ar
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/models/X2Flow.php
Methods summary
public static X2Flow
# model( string $className = __CLASS__ )

Returns the static model of the specified AR class.

Returns the static model of the specified AR class.

Parameters

$className
string
$className active record class name.

Returns

X2Flow
the static model class

Overrides

CActiveRecord::model()
public string
# tableName( )

Returns

string
the associated database table name

Overrides

CActiveRecord::tableName()
public array
# rules( )

Returns

array
validation rules for model attributes.

Overrides

X2ActiveRecord::rules()
public
# getFlow( mixed $refresh = false )
public
# setFlow( array $flow )
public
# validateFlow( mixed $attribute )

Ensure validity of specified config options

Ensure validity of specified config options

public
# afterSave( )

This method is invoked after saving a record successfully. The default implementation raises the CActiveRecord::onAfterSave() event. You may override this method to do postprocessing after record saving. Make sure you call the parent implementation so that the event is raised properly.

This method is invoked after saving a record successfully. The default implementation raises the CActiveRecord::onAfterSave() event. You may override this method to do postprocessing after record saving. Make sure you call the parent implementation so that the event is raised properly.

Overrides

CActiveRecord::afterSave()
public array
# behaviors( )

Returns a list of behaviors that this model should behave as.

Returns a list of behaviors that this model should behave as.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

CModel::behaviors()
public array
# attributeLabels( )

Returns

array
customized attribute labels (name=>label)

Overrides

CModel::attributeLabels()
public CActiveDataProvider
# search( )

Retrieves a list of models based on the current search/filter conditions.

Retrieves a list of models based on the current search/filter conditions.

Returns

CActiveDataProvider
the data provider that can return the models based on the search/filter conditions.
public boolean
# beforeValidate( )

Validates the JSON data in $flow. Sets createDate and lastUpdated.

Validates the JSON data in $flow. Sets createDate and lastUpdated.

Returns

boolean
whether or not to proceed to validation

Overrides

CModel::beforeValidate()
public static integer
# triggerDepth( )

Returns the current trigger stack depth X2Flow::$_triggerDepth

Returns the current trigger stack depth X2Flow::$_triggerDepth

Returns

integer
the stack depth
public static mixed
# trigger( string $triggerName, array $params = array() )

Looks up and runs automation actions that match the provided trigger name and parameters.

Looks up and runs automation actions that match the provided trigger name and parameters.

Parameters

$triggerName
string
$trigger the name of the trigger to fire
$params
array
$params an associative array of params, usually including 'model'=>$model, the primary X2Model to which this trigger applies.

Returns

mixed
Null or return value of extractRetValFromTrace
public static mixed
# extractRetValFromTrace( array $flowTrace )

Traverses the trace tree and checks if the last action has a return value. If so, that value is returned. Otherwise, null is returned.

Traverses the trace tree and checks if the last action has a return value. If so, that value is returned. Otherwise, null is returned.

Parameters

$flowTrace
array
the trace returned by executeFlow

Returns

mixed
null if there's no return value, mixed otherwise
public static
# resumeFlowExecution( X2Flow & $flow, array & $params, mixed $actionId = null, mixed $triggerLogId = null )

Can be called to resume execution of flow that paused for the wait action.

Can be called to resume execution of flow that paused for the wait action.

Parameters

$flow
X2Flow
&$flow the object representing the flow to run
$params
array
&$params an associative array of params, usually including 'model'=>$model,
$actionId
mixed
$flowPath an array of directions to a specific point in the flow. Defaults to null.
$triggerLogId
public static
# executeFlow( mixed & $flow, mixed & $params, mixed $actionId = null )

Wrapper around _executeFlow which respects trigger depth restriction

Wrapper around _executeFlow which respects trigger depth restriction

public
# executeBranch( array & $flowItems, array & $params, array $triggerLogId = null )

Executes each action in a given branch, starting at $start.

Executes each action in a given branch, starting at $start.

Parameters

$flowItems
array
$flowPath directions to the current position in the flow tree
$params
array
$flowItems the items in this branch
$triggerLogId
array
&$params an associative array of params, usually including 'model'=>$model,
public
# validateAndExecute( mixed $item, mixed $flowAction, mixed & $params, mixed $triggerLogId = null )
public static
# parseValue( mixed $value, mixed $type, mixed & $params = null, mixed $renderFlag = true )
public static
# getModelTypes( mixed $assoc = false )
Methods inherited from X2ActiveRecord
getAllErrorMessages(), getBehaviorRules(), getFormatter(), getInputRenderer(), getName(), renderAttribute(), setFormatter(), setInputRenderer()
Methods inherited from CActiveRecord
__call(), __construct(), __get(), __isset(), __set(), __sleep(), __unset(), addRelatedRecord(), afterDelete(), afterFind(), afterFindInternal(), applyScopes(), attributeNames(), beforeCount(), beforeDelete(), beforeFind(), beforeFindInternal(), beforeSave(), cache(), count(), countByAttributes(), countBySql(), defaultScope(), delete(), deleteAll(), deleteAllByAttributes(), deleteByPk(), equals(), exists(), find(), findAll(), findAllByAttributes(), findAllByPk(), findAllBySql(), findByAttributes(), findByPk(), findBySql(), getActiveFinder(), getActiveRelation(), getAttribute(), getAttributeLabel(), getAttributes(), getCommandBuilder(), getDbConnection(), getDbCriteria(), getIsNewRecord(), getMetaData(), getOldPrimaryKey(), getPrimaryKey(), getRelated(), getTableAlias(), getTableSchema(), hasAttribute(), hasRelated(), init(), insert(), instantiate(), offsetExists(), onAfterDelete(), onAfterFind(), onAfterSave(), onBeforeCount(), onBeforeDelete(), onBeforeFind(), onBeforeSave(), populateRecord(), populateRecords(), primaryKey(), query(), refresh(), refreshMetaData(), relations(), resetScope(), save(), saveAttributes(), saveCounters(), scopes(), setAttribute(), setDbCriteria(), setIsNewRecord(), setOldPrimaryKey(), setPrimaryKey(), setTableAlias(), together(), update(), updateAll(), updateByPk(), updateCounters(), with()
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), clearErrors(), createValidators(), generateAttributeLabel(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), setAttributes(), setScenario(), unsetAttributes(), validate()
Methods inherited from CComponent
asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
integer MAX_TRIGGER_DEPTH 0
#

Const

max number of nested calls to X2Flow::trigger()
Constants inherited from CActiveRecord
BELONGS_TO, HAS_MANY, HAS_ONE, MANY_MANY, STAT
Properties inherited from X2ActiveRecord
$fieldFormatterClass, $fieldInputRendererClass
Properties inherited from CActiveRecord
$db
Magic properties inherited from CActiveRecord
$attributes, $commandBuilder, $dbConnection, $dbCriteria, $isNewRecord, $metaData, $oldPrimaryKey, $primaryKey, $tableAlias, $tableSchema
Magic properties inherited from CModel
$errors, $iterator, $safeAttributeNames, $scenario, $validatorList, $validators
X2CRM Documentation API documentation generated by ApiGen 2.8.0