PHP Class Model_Auth_User, php-framework-benchmarks

Inheritance: extends ORM
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$_callbacks Validation callbacks
$_has_many Relationships
$_ignored_columns Columns to ignore
$_labels Field labels
$_rules Validation rules

Public Methods

Method Description
change_password ( array &$array, $redirect = FALSE ) : boolean Validates an array for a matching password and password_confirm field, and optionally redirects after a successful save.
complete_login ( ) : void Complete the login for a user by incrementing the logins and saving login timestamp
email_available ( Validate $array, $field ) : void Does the reverse of unique_key_exists() by triggering error if email exists.
login ( array &$array, $redirect = FALSE ) : boolean Validates login information from an array, and optionally redirects after a successful login.
save ( ) : ORM Saves the current object. Will hash password if it was changed.
unique_key ( $value ) : string Allows a model use both email and username as unique identifiers for login
unique_key_exists ( $value, $field = NULL ) : boolean Tests if a unique key value exists in the database.
username_available ( Validate $array, $field ) : void Does the reverse of unique_key_exists() by triggering error if username exists.

Method Details

change_password() public method

Validates an array for a matching password and password_confirm field, and optionally redirects after a successful save.
public change_password ( array &$array, $redirect = FALSE ) : boolean
$array array
return boolean

complete_login() public method

Complete the login for a user by incrementing the logins and saving login timestamp
public complete_login ( ) : void
return void

email_available() public method

Validation callback.
public email_available ( Validate $array, $field ) : void
$array Validate
return void

login() public method

Validates login information from an array, and optionally redirects after a successful login.
public login ( array &$array, $redirect = FALSE ) : boolean
$array array
return boolean

save() public method

Saves the current object. Will hash password if it was changed.
public save ( ) : ORM
return ORM

unique_key() public method

Allows a model use both email and username as unique identifiers for login
public unique_key ( $value ) : string
return string field name

unique_key_exists() public method

Tests if a unique key value exists in the database.
public unique_key_exists ( $value, $field = NULL ) : boolean
return boolean

username_available() public method

Validation callback.
public username_available ( Validate $array, $field ) : void
$array Validate
return void

Property Details

$_callbacks protected property

Validation callbacks
protected $_callbacks

$_has_many protected property

Relationships
protected $_has_many

$_ignored_columns protected property

Columns to ignore
protected $_ignored_columns

$_labels protected property

Field labels
protected $_labels

$_rules protected property

Validation rules
protected $_rules