Class Fields
This is the model class for table "x2_fields".
- CComponent
- CModel implements IteratorAggregate, ArrayAccess
- CActiveRecord
- Fields
Author: Jake Houser <jake@x2engine.com>, Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/models/Fields.php
public
|
|
public
array
|
#
behaviors( )
Returns a list of behaviors that this model should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure: 'behaviorName'=>array( 'class'=>'path.to.BehaviorClass', 'property1'=>'value1', 'property2'=>'value2', ) |
public
|
|
public
|
|
public
|
#
setAttributes( array $values, boolean $safeOnly = true )
Sets the attribute values in a massive way. |
public
array
|
|
public
integer
|
|
public static
|
|
public static
array
|
|
public static
array
|
|
public static
mixed
|
|
public static
CHtmlPurifier
|
|
public static
|
|
public static
|
#
nameAndId( string $nameId )
The inverse operation of
|
public static
|
|
public static
|
|
public static
string
|
#
parseUsers( mixed $arr )
Implodes an array of usernames for multiple assignment fields. This method, if still used anyhwere, could be refactored to use JSON |
public static
string
|
#
parseUsersTwo( array $arr )
Similar to |
public static
|
|
public static
|
#
strToNumeric( string $input, string $type = 'float', string $curSym = null )
Converts a string into a numeric value. |
public
boolean
|
#
beforeSave( )
Table modification is performed before field update since field should not be saved if column data type cannot be updated TODO: place column modification in a transaction with field update |
public
type
|
|
public
|
#
afterDelete( )
This method is invoked after deleting a record. The default implementation
raises the |
public
array
|
|
public
boolean
|
|
public
|
|
public
|
|
public
|
#
createIndex( mixed $unique = false )
Creates an index on the column associated with the current field record. |
public
|
|
public
|
|
public
type
|
|
public
|
#
nonReserved( mixed $attribute, mixed $params = array() )
Validator for ensuring an identifier does not include MySQL reserved words or X2Engine reserved words |
public
mixed
|
#
parseValue( mixed $value, boolean $filter = false )
Parses a value for table insertion using X2Fields rules |
public
array
|
|
public
CActiveDataProvider
|
|
public
string
|
|
public
|
#
requiredUnique( mixed $attribute, mixed $params = array() )
Validator that prevents adding a unique constraint to a field without also making it required. |
public
|
#
uniqueFieldName( type $attribute, type $params = array() )
Check that the combination of model and field name will not conflict with any existing one. |
public
|
#
validDefault( string $attribute, array $params = array() )
Check that the default value is appropriate given the type of the field. |
public
|
#
validCustom( string $attribute, array $params = array() )
Alter/purify the input for the custom data field. |
public
|
|
public static
|
__call(),
__get(),
__isset(),
__set(),
__sleep(),
__unset(),
addRelatedRecord(),
afterFind(),
afterFindInternal(),
applyScopes(),
attributeNames(),
beforeCount(),
beforeDelete(),
beforeFind(),
beforeFindInternal(),
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(),
resetScope(),
save(),
saveAttributes(),
saveCounters(),
scopes(),
setAttribute(),
setDbCriteria(),
setIsNewRecord(),
setOldPrimaryKey(),
setPrimaryKey(),
setTableAlias(),
together(),
update(),
updateAll(),
updateByPk(),
updateCounters(),
with()
|
addError(),
addErrors(),
afterConstruct(),
afterValidate(),
clearErrors(),
createValidators(),
generateAttributeLabel(),
getError(),
getErrors(),
getIterator(),
getSafeAttributeNames(),
getScenario(),
getValidatorList(),
getValidators(),
hasErrors(),
isAttributeRequired(),
isAttributeSafe(),
offsetGet(),
offsetSet(),
offsetUnset(),
onAfterConstruct(),
onAfterValidate(),
onBeforeValidate(),
onUnsafeAttribute(),
setScenario(),
unsetAttributes(),
validate()
|
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
string |
NAMEID_DELIM
|
'_' |
#
Defines the separator between name & ID in uniquely identifying "nameId" fields |
string |
MULTI_ASSIGNMENT_DELIM
|
', ' |
|
integer |
RATING_MIN
|
1 |
|
integer |
RATING_MAX
|
5 |
|
integer |
WRITE_PERMISSION
|
2 |
|
integer |
READ_PERMISSION
|
1 |
|
integer |
NO_PERMISSION
|
0 |
BELONGS_TO,
HAS_MANY,
HAS_ONE,
MANY_MANY,
STAT
|
public
boolean
|
$includeEmpty | true |
|
public static
type
|
$phpTypes | array(
'assignment' => 'string',
'boolean' => 'boolean',
'credentials' => 'integer',
'currency' => 'double',
'date' => 'integer',
'dateTime' => 'integer',
'dropdown' => 'string',
'email' => 'string',
'int' => 'integer',
'link' => 'string',
'optionalAssignment' => 'string',
'percentage' => 'double',
'rating' => 'integer',
'varchar' => 'string',
) |
#
PHP types corresponding to field types in X2Engine. |
$db
|
public
integer
|
$id | |
public
string
|
$modelName | |
public
string
|
$fieldName | |
public
string
|
$attributeLabel | |
public
integer
|
$show | |
public
integer
|
$custom | |
public
string
|
$myTableName |
#
The name of the table to which the field corresponds |
$attributes,
$commandBuilder,
$dbConnection,
$dbCriteria,
$isNewRecord,
$metaData,
$oldPrimaryKey,
$primaryKey,
$tableAlias,
$tableSchema
|
$errors,
$iterator,
$safeAttributeNames,
$scenario,
$validatorList,
$validators
|