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

  • ActionMetaData
  • ActionText
  • Admin
  • AmorphousModel
  • ApiHook
  • APIModel
  • ChartSetting
  • ContactForm
  • ContactList
  • Credentials
  • Criteria
  • Dropdowns
  • Events
  • EventsData
  • Fields
  • FormLayout
  • Imports
  • InlineEmail
  • LeadRouting
  • Locations
  • LoginForm
  • Maps
  • Modules
  • Notes
  • Notification
  • PhoneNumber
  • Profile
  • Record
  • Relationships
  • Roles
  • RoleToPermission
  • RoleToUser
  • RoleToWorkflow
  • Rules
  • Session
  • SessionLog
  • Social
  • Tags
  • TempFile
  • Tips
  • Tours
  • TrackEmail
  • TriggerLog
  • URL
  • ViewLog
  • Widgets
  • X2List
  • X2ListCriterion
  • X2ListItem
  • X2Model
  • Overview
  • Package
  • Class
  • Tree

Class X2List

This is the model class for table "x2_lists".

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CActiveRecord
Extended by X2ActiveRecord
Extended by X2Model
Extended by X2List

Direct known subclasses

ContactList
Package: application\models
Located at x2engine/protected/modules/contacts/models/X2List.php
Methods summary
public static static
# model( string $className = __CLASS__ )

Returns the static model of the specified AR class. The model returned is a static instance of the AR class. It is provided for invoking class-level methods (something similar to static class methods.)

Returns the static model of the specified AR class. The model returned is a static instance of the AR class. It is provided for invoking class-level methods (something similar to static class methods.)

EVERY derived AR class must override this method as follows,

public static function model($className=__CLASS__)
{
    return parent::model($className);
}

Parameters

$className
string
$className active record class name.

Returns

static
active record model instance.

Overrides

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

Returns the name of the associated database table

Returns the name of the associated database table

Returns

string
the associated database table name

Overrides

CActiveRecord::tableName()
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

X2Model::behaviors()
public array
# rules( )

Generates validation rules for custom fields

Generates validation rules for custom fields

Returns

array
validation rules for model attributes.

Overrides

X2Model::rules()
public array
# relations( )

This method should be overridden to declare related objects.

This method should be overridden to declare related objects.

There are four types of relations that may exist between two active record objects:
  • BELONGS_TO: e.g. a member belongs to a team;
  • HAS_ONE: e.g. a member has at most one profile;
  • HAS_MANY: e.g. a team has many members;
  • MANY_MANY: e.g. a member has many skills and a skill belongs to a member.

Besides the above relation types, a special relation called STAT is also supported that can be used to perform statistical query (or aggregational query). It retrieves the aggregational information about the related objects, such as the number of comments for each post, the average rating for each product, etc.

Each kind of related objects is defined in this method as an array with the following elements:

'varName'=>array('relationType', 'className', 'foreignKey', ...additional options)

where 'varName' refers to the name of the variable/property that the related object(s) can be accessed through; 'relationType' refers to the type of the relation, which can be one of the following four constants: self::BELONGS_TO, self::HAS_ONE, self::HAS_MANY and self::MANY_MANY; 'className' refers to the name of the active record class that the related object(s) is of; and 'foreignKey' states the foreign key that relates the two kinds of active record. Note, for composite foreign keys, they can be either listed together, separated by commas or specified as an array in format of array('key1','key2'). In case you need to specify custom PK->FK association you can define it as array('fk'=>'pk'). For composite keys it will be array('fk_c1'=>'pk_с1','fk_c2'=>'pk_c2'). For foreign keys used in MANY_MANY relation, the joining table must be declared as well (e.g. 'join_table(fk1, fk2)').

Additional options may be specified as name-value pairs in the rest array elements:
  • 'select': string|array, a list of columns to be selected. Defaults to '*', meaning all columns. Column names should be disambiguated if they appear in an expression (e.g. COUNT(relationName.name) AS name_count).
  • 'condition': string, the WHERE clause. Defaults to empty. Note, column references need to be disambiguated with prefix 'relationName.' (e.g. relationName.age>20)
  • 'order': string, the ORDER BY clause. Defaults to empty. Note, column references need to be disambiguated with prefix 'relationName.' (e.g. relationName.age DESC)
  • 'with': string|array, a list of child related objects that should be loaded together with this object. Note, this is only honored by lazy loading, not eager loading.
  • 'joinType': type of join. Defaults to 'LEFT OUTER JOIN'.
  • 'alias': the alias for the table associated with this relationship. It defaults to null, meaning the table alias is the same as the relation name.
  • 'params': the parameters to be bound to the generated SQL statement. This should be given as an array of name-value pairs.
  • 'on': the ON clause. The condition specified here will be appended to the joining condition using the AND operator.
  • 'index': the name of the column whose values should be used as keys of the array that stores related objects. This option is only available to HAS_MANY and MANY_MANY relations.
  • 'scopes': scopes to apply. In case of a single scope can be used like 'scopes'=>'scopeName', in case of multiple scopes can be used like 'scopes'=>array('scopeName1','scopeName2'). This option has been available since version 1.1.9.
The following options are available for certain relations when lazy loading:
  • 'group': string, the GROUP BY clause. Defaults to empty. Note, column references need to be disambiguated with prefix 'relationName.' (e.g. relationName.age). This option only applies to HAS_MANY and MANY_MANY relations.
  • 'having': string, the HAVING clause. Defaults to empty. Note, column references need to be disambiguated with prefix 'relationName.' (e.g. relationName.age). This option only applies to HAS_MANY and MANY_MANY relations.
  • 'limit': limit of the rows to be selected. This option does not apply to BELONGS_TO relation.
  • 'offset': offset of the rows to be selected. This option does not apply to BELONGS_TO relation.
  • 'through': name of the model's relation that will be used as a bridge when getting related data. Can be set only for HAS_ONE and HAS_MANY. This option has been available since version 1.1.7.

Below is an example declaring related objects for 'Post' active record class:

return array(
    'author'=>array(self::BELONGS_TO, 'User', 'author_id'),
    'comments'=>array(self::HAS_MANY, 'Comment', 'post_id', 'with'=>'author', 'order'=>'create_time DESC'),
    'tags'=>array(self::MANY_MANY, 'Tag', 'post_tag(post_id, tag_id)', 'order'=>'name'),
);

Returns

array
list of related object declarations. Defaults to empty array.

Overrides

X2Model::relations()
public array
# attributeLabels( )

Returns custom attribute values defined in x2_fields

Returns custom attribute values defined in x2_fields

Returns

array
customized attribute labels (name=>label)

See

CModel::generateAttributeLabel()

Overrides

X2Model::attributeLabels()
public static array
# getComparisonList( )

An array of valid comparison operators for criteria in dynamic lists

An array of valid comparison operators for criteria in dynamic lists

Returns

array
public
# getDefaultRoute( )
public
# getDisplayName( mixed $plural = true, mixed $ofModule = true )

Overrides

X2Model::getDisplayName()
public
# createLink( )
public
# afterDelete( )

When a list is deleted, remove its entries in x2_list_items

When a list is deleted, remove its entries in x2_list_items

Overrides

X2Model::afterDelete()
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
# getItemFields( )
public
# getItemAttributeLabels( )
public static
# load( mixed $id )
public
# calculateCount( )
public CDbCriteria
# queryCriteria( mixed $useAccessRules = true )

Returns a CDbCriteria to retrieve all models specified by the list

Returns a CDbCriteria to retrieve all models specified by the list

Returns

CDbCriteria
Criteria to retrieve all models in the list
public CDbCommand
# queryCommand( mixed $useAccessRules = true )

Returns a CDbCommand to retrieve all records in the list

Returns a CDbCommand to retrieve all records in the list

Returns

CDbCommand
Command to retrieve all records in the list
public CActiveDataProvider
# dataProvider( mixed $pageSize = null, mixed $sort = null )

Returns a data provider for all the models in the list

Returns a data provider for all the models in the list

Returns

CActiveDataProvider
A data provider serving out all the models in the list
public static Array
# getVcrLinks( CActiveDataProvider & $dataProvider, Integer $modelId )

Generates an array of links for the VCR controls based on the specified dataprovider and current ID

Generates an array of links for the VCR controls based on the specified dataprovider and current ID

Parameters

$dataProvider
CActiveDataProvider
$dataProvider the data provider of the most recent gridview
$modelId
Integer
$id the ID of the current record

Returns

Array
array of VCR links and stats
public CSqlDataProvider
# statusDataProvider( mixed $pageSize = null )

Returns an array data provider for all models in the list, including the list_item status columns

Returns an array data provider for all models in the list, including the list_item status columns

Returns

CSqlDataProvider
public CSqlDataProvider
# campaignDataProvider( mixed $pageSize = null )

Return a SQL data provider for a list of emails in a campaign includes associated contact info with each email

Return a SQL data provider for a list of emails in a campaign includes associated contact info with each email

Returns

CSqlDataProvider
public integer
# statusCount( mixed $type )

Returns the count of items in the list that have the specified status (i.e. sent, opened, clicked, unsubscribed)

Returns the count of items in the list that have the specified status (i.e. sent, opened, clicked, unsubscribed)

Returns

integer
public X2List|null
# staticDuplicate( )

Creates, saves, and returns a duplicate static list containing the same items.

Creates, saves, and returns a duplicate static list containing the same items.

Returns

X2List|null
The active record model for the static clone is returned if the operation was successful; otherwise Null is returned.
public
# addIds( mixed $ids )

Adds the specified ID(s) to this list (if they're not already in there)

Adds the specified ID(s) to this list (if they're not already in there)

Parameters

$ids
mixed
$ids a single integer or an array of integer IDs
public
# processCriteria( )

Save associated criterion objects for a dynamic list

Save associated criterion objects for a dynamic list

Takes data from the dynamic list criteria designer form and turns them into X2ListCriterion records.

public
# removeIds( mixed $ids )

Removes the specified ID(s) from this list

Removes the specified ID(s) from this list

Parameters

$ids
mixed
$ids a single integer or an array of integer IDs
public
# hasRecord( mixed $model )
public static
# getRoute( mixed $id )
public static
# getAllStaticListNames( mixed $controller )
public
# setAttributes( array $values, boolean $safeOnly = true )

Sets the attribute values in a massive way.

Sets the attribute values in a massive way.

Parameters

$values
array
$values attribute values (name=>value) to be set.
$safeOnly
boolean
$safeOnly whether the assignments should only be done to the safe attributes. A safe attribute is one that is associated with a validation rule in the current scenario.

See

CModel::getSafeAttributeNames()
CActiveRecord::attributeNames()

Overrides

CModel::setAttributes()
public
# afterSave( )

Runs when a model is saved. Scans attributes for phone numbers and index them in x2_phone_numbers. Updates x2_relationships table based on link type fields. Fires onAfterSave event.

Runs when a model is saved. Scans attributes for phone numbers and index them in x2_phone_numbers. Updates x2_relationships table based on link type fields. Fires onAfterSave event.

Overrides

X2Model::afterSave()
public
# filter( array $lists )

Filter array of lists based on attributes of this list

Filter array of lists based on attributes of this list

Methods inherited from X2Model
__construct(), afterCreate(), afterFind(), afterUpdate(), attributeChanged(), beforeSave(), checkThrowAttrError(), compareAssignment(), compareAttribute(), compareAttributes(), compareBoolean(), compareDropdown(), duplicateFields(), findAll(), findByAttributes(), findByEmail(), findByNameId(), findByPkInArray(), getAllRecordNames(), getAssignmentOptions(), getAssociationModel(), getAssociationType(), getAssociationTypeOptions(), getAttribute(), getAttributeLabel(), getAttributeLabels(), getDefaultAssignment(), getDefaultFormLayout(), getEditableAttributeNames(), getEditableFieldNames(), getField(), getFieldComparisonOptions(), getFieldPermissions(), getFields(), getFieldsForDropdown(), getInsertableAttributeTokens(), getIsExemptFromFieldLevelPermissions(), getLinkedAttribute(), getLinkedModel(), getLinkedModelMock(), getModelLink(), getModelLinkMock(), getModelName(), getModelNames(), getModelOfTypeWithId(), getModelOfTypeWithName(), getModelTitle(), getModelTypes(), getModelTypesWhichSupportRelationships(), getModelTypesWhichSupportWorkflow(), getModelsFromNames(), getModuleModel(), getModuleModelName(), getModuleModelNames(), getModuleModelsByName(), getModuleName(), getModules(), getMyModelName(), getOldAttributes(), getPhoneNumber(), getReadableAttributeNames(), getRecordName(), getSort(), getStaticLinkedModels(), getSummaryFields(), getTableNames(), getTranslatedModelTitles(), getVisibleAttributes(), hide(), insert(), isModuleModelName(), massUpdateNameId(), model2(), modelRules(), onAfterCreate(), onAfterInsert(), onAfterUpdate(), query(), queryFields(), renderErroneousField(), renderInput(), renderLinkedAttribute(), renderMergeInput(), renderModelAutocomplete(), renderModelInput(), resetFieldsPropertyCache(), runWithoutBehavior(), save(), searchBase(), setX2Fields(), translatedAttributeLabel(), unshiftOperator(), updateNameId(), updateNameIdRefs(), updateTimerTotals()
Methods inherited from X2ActiveRecord
getAllErrorMessages(), getBehaviorRules(), getFormatter(), getInputRenderer(), getName(), renderAttribute(), setFormatter(), setInputRenderer()
Methods inherited from CActiveRecord
__call(), __get(), __isset(), __set(), __sleep(), __unset(), addRelatedRecord(), afterFindInternal(), applyScopes(), attributeNames(), beforeCount(), beforeDelete(), beforeFind(), beforeFindInternal(), cache(), count(), countByAttributes(), countBySql(), defaultScope(), delete(), deleteAll(), deleteAllByAttributes(), deleteByPk(), equals(), exists(), find(), findAllByAttributes(), findAllByPk(), findAllBySql(), findByPk(), findBySql(), getActiveFinder(), getActiveRelation(), getAttributes(), getCommandBuilder(), getDbConnection(), getDbCriteria(), getIsNewRecord(), getMetaData(), getOldPrimaryKey(), getPrimaryKey(), getRelated(), getTableAlias(), getTableSchema(), hasAttribute(), hasRelated(), init(), instantiate(), offsetExists(), onAfterDelete(), onAfterFind(), onAfterSave(), onBeforeCount(), onBeforeDelete(), onBeforeFind(), onBeforeSave(), populateRecord(), populateRecords(), primaryKey(), refresh(), refreshMetaData(), resetScope(), saveAttributes(), saveCounters(), scopes(), setAttribute(), setDbCriteria(), setIsNewRecord(), setOldPrimaryKey(), setPrimaryKey(), setTableAlias(), together(), update(), updateAll(), updateByPk(), updateCounters(), with()
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), beforeValidate(), clearErrors(), createValidators(), generateAttributeLabel(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), 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 inherited from CActiveRecord
BELONGS_TO, HAS_MANY, HAS_ONE, MANY_MANY, STAT
Properties summary
public type $criteriaInput
#

Attribute name, comparison operator and comparison value arrays for criteria generation.

Attribute name, comparison operator and comparison value arrays for criteria generation.

public true $supportsWorkflow false
#

if this model can have workflows associated with it, false otherwise

if this model can have workflows associated with it, false otherwise

Properties inherited from X2Model
$_editableFieldNames, $_fieldPermissions, $_fields, $_linkedModels, $_nameIdRefs, $_oldAttributes, $_runAfterCreate, $associationModels, $autoPopulateFields, $dbPersistentGridSettings, $disablePersistentGridSettings, $fieldFormatterClass, $modelNameToModuleName, $subScenario, $supportsFieldLevelPermissions, $translatedModelTitles, $uid
Properties inherited from X2ActiveRecord
$fieldInputRendererClass
Properties inherited from CActiveRecord
$db
Magic properties inherited from X2Model
$fieldPermissions, $isExemptFromFieldLevelPermissions, $myModelName, $readableAttributeNames, $relatedX2Models
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