Class User
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
-
CModel implements IteratorAggregate, ArrayAccess
-
CActiveRecord
-
User
Direct known subclasses
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id$
Since: 1.0
Located at mishamx/yii-user/models/User.php
Methods summary
public static
CActiveRecord
|
|
public
string
|
|
public
array
|
|
public
array
|
|
public
array
|
|
public
array
|
#
scopes( )
Returns the declaration of named scopes. A named scope represents a query criteria that can be chained together with other named scopes and applied to a query. This method should be overridden by child classes to declare named scopes for the particular AR classes. For example, the following code declares two named scopes: 'recently' and 'published'. return array( 'published'=>array( 'condition'=>'status=1', ), 'recently'=>array( 'order'=>'create_time DESC', 'limit'=>5, ), ); If the above scopes are declared in a 'Post' model, we can perform the following queries: $posts=Post::model()->published()->findAll(); $posts=Post::model()->published()->recently()->findAll(); $posts=Post::model()->published()->with('comments')->findAll(); Note that the last query is a relational query. |
public
array
|
#
defaultScope( )
Returns the default named scope that should be implicitly applied to all queries for this model. Note, default scope only applies to SELECT queries. It is ignored for INSERT, UPDATE and DELETE queries. The default implementation simply returns an empty array. You may override this method if the model needs to be queried with some default criteria (e.g. only active records should be returned). |
public static
|
|
public
CActiveDataProvider
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
afterSave( )
This method is invoked after saving a record successfully. The default
implementation raises the |
Methods inherited from CActiveRecord
__call()
,
__construct()
,
__get()
,
__isset()
,
__set()
,
__sleep()
,
__unset()
,
addRelatedRecord()
,
afterDelete()
,
afterFind()
,
afterFindInternal()
,
applyScopes()
,
attributeNames()
,
beforeDelete()
,
beforeFind()
,
beforeFindInternal()
,
beforeSave()
,
cache()
,
count()
,
countByAttributes()
,
countBySql()
,
delete()
,
deleteAll()
,
deleteAllByAttributes()
,
deleteByPk()
,
equals()
,
exists()
,
find()
,
findAll()
,
findAllByAttributes()
,
findAllByPk()
,
findAllBySql()
,
findByAttributes()
,
findByPk()
,
findBySql()
,
getActiveRelation()
,
getAttribute()
,
getAttributeLabel()
,
getAttributes()
,
getCommandBuilder()
,
getDbConnection()
,
getDbCriteria()
,
getIsNewRecord()
,
getMetaData()
,
getOldPrimaryKey()
,
getPrimaryKey()
,
getRelated()
,
getTableAlias()
,
getTableSchema()
,
hasAttribute()
,
hasRelated()
,
init()
,
insert()
,
instantiate()
,
offsetExists()
,
onAfterDelete()
,
onAfterFind()
,
onAfterSave()
,
onBeforeDelete()
,
onBeforeFind()
,
onBeforeSave()
,
populateRecord()
,
populateRecords()
,
primaryKey()
,
query()
,
refresh()
,
refreshMetaData()
,
resetScope()
,
save()
,
saveAttributes()
,
saveCounters()
,
setAttribute()
,
setDbCriteria()
,
setIsNewRecord()
,
setOldPrimaryKey()
,
setPrimaryKey()
,
setTableAlias()
,
together()
,
update()
,
updateAll()
,
updateByPk()
,
updateCounters()
,
with()
Methods inherited from CModel
addError()
,
addErrors()
,
afterConstruct()
,
afterValidate()
,
beforeValidate()
,
behaviors()
,
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()
Magic methods summary
Constants summary
integer |
STATUS_NOACTIVE
|
0 |
|
integer |
STATUS_ACTIVE
|
1 |
|
integer |
STATUS_BANNED
|
-1 |
|
integer |
STATUS_BANED
|
-1 |
Constants inherited from CActiveRecord
BELONGS_TO
,
HAS_MANY
,
HAS_ONE
,
MANY_MANY
,
STAT
Properties summary
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