PHP Class AdminUser

The followings are the available columns in table 'p2_adminuser':
Inheritance: extends ActiveRecord
显示文件 Open project: yinhe/yincart Class Usage Examples

Public Methods

Method Description
attributeLabels ( ) : array
hashPassword ( $password ) : string Generates the password hash.
model ( string $className = __CLASS__ ) : AdminUser Returns the static model of the specified AR class.
relations ( ) : array
rules ( ) : array
search ( ) : CActiveDataProvider Retrieves a list of models based on the current search/filter conditions.
tableName ( ) : string
validatePassword ( $password ) : boolean Checks if the given password is correct.

Protected Methods

Method Description
generateSalt ( $cost = 10 ) : string Generates a salt that can be used to generate a password hash.

Method Details

attributeLabels() public method

public attributeLabels ( ) : array
return array customized attribute labels (name=>label)

generateSalt() protected method

The {@link http://php.net/manual/en/function.crypt.php PHP crypt() built-in function} requires, for the Blowfish hash algorithm, a salt string in a specific format: - "$2a$" - a two digit cost parameter - "$" - 22 characters from the alphabet "./0-9A-Za-z".
protected generateSalt ( $cost = 10 ) : string
return string the salt

hashPassword() public method

Generates the password hash.
public hashPassword ( $password ) : string
return string hash

model() public static method

Returns the static model of the specified AR class.
public static model ( string $className = __CLASS__ ) : AdminUser
$className string active record class name.
return AdminUser the static model class

relations() public method

public relations ( ) : array
return array relational rules.

rules() public method

public rules ( ) : array
return array validation rules for model attributes.

tableName() public method

public tableName ( ) : string
return string the associated database table name

validatePassword() public method

Checks if the given password is correct.
public validatePassword ( $password ) : boolean
return boolean whether the password is valid