PHP Class Model_A1_User_Sprig

Remember to validate data before saving to database. Some validation rules are already taken care of by the _init() method. Min_length and max_length are set for both username and password, both these fields are already required, and the username will be checked on uniqueness. However, you might want to add additional rules to validate if username is alphanumeric for example. If defining logins and last_login fields, add the following to the _init() in the custom user model class: $this->_fields += array( 'logins' => new Sprig_Field_Integer(array( 'default' => 0, 'editable' => FALSE, )), 'last_login' => new Sprig_Field_Integer(array( 'default' => 0, 'editable' => FALSE, )),
Inheritance: extends Sprig
Mostrar archivo Open project: wouterrr/a1 Class Usage Examples

Protected Properties

Property Type Description
$_name Specify config name so password gets hashed correctly (with the right salt pattern) when set in user

Public Methods

Method Description
_init ( ) Set the username, password, and token fields
hash_password ( Validate $array, $field ) : string Hash callback using the A1 library

Method Details

_init() public method

Set the username, password, and token fields
public _init ( )

hash_password() public method

Hash callback using the A1 library
public hash_password ( Validate $array, $field ) : string
$array Validate
return string

Property Details

$_name protected_oe property

Specify config name so password gets hashed correctly (with the right salt pattern) when set in user
protected $_name