Phundament App Class Reference
  • Package
  • Class
  • Tree

Packages

  • bootstrap
    • widgets
      • input
  • Image
  • None
  • p3admin
  • p3extensions
    • behaviors
    • commands
    • components
    • helpers
    • widgets
  • p3media
    • actions
    • controllers
    • models
  • p3pages
    • models
  • p3widgets
    • components
    • models
  • PHP
  • system
    • db
      • ar
    • gii
    • web
      • auth
      • helpers
      • widgets
  • yiiext
    • widgets
      • fancybox
      • lipsum
  • zii
    • widgets
      • grid

Classes

  • CSaveRelationsBehavior
  • OwnerBehavior
  • Profile
  • ProfileField
  • TimestampBehavior
  • UActiveRecord
  • User

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
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CActiveRecord
Extended by User

Direct known subclasses

RegistrationForm

Package: system\db\ar
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
# 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

CActiveRecord
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

CModel::rules
public array
# relations( )

Returns

array
relational rules.

Overrides

CActiveRecord::relations
public array
# attributeLabels( )

Returns

array
customized attribute labels (name=>label)

Overrides

CModel::attributeLabels
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.

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.

Returns

array
the scope definition. The array keys are scope names; the array values are the corresponding scope definitions. Each scope definition is represented as an array whose keys must be properties of CDbCriteria.

Overrides

CActiveRecord::scopes
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).

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).

Returns

array
the query criteria. This will be used as the parameter to the constructor of CDbCriteria.

Overrides

CActiveRecord::defaultScope
public static
# itemAlias( mixed $type, mixed $code = NULL )
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
# getCreatetime( )
public
# setCreatetime( mixed $value )
public
# getLastvisit( )
public
# setLastvisit( mixed $value )
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

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

Phundament App Class Reference API documentation generated by ApiGen 2.8.0