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,
)),
Afficher le fichier
Open project: wouterrr/a1
Class Usage Examples
Protected Properties
Свойство |
Type |
Description |
|
$_name |
|
Specify config name so password gets hashed correctly
(with the right salt pattern) when set in user |
|
Méthodes publiques
Méthode |
Description |
|
_init ( ) |
Set the username, password, and token fields |
|
hash_password ( Validate $array, $field ) : string |
Hash callback using the A1 library |
|
Method Details
Set the username, password, and token fields
hash_password()
public méthode
Hash callback using the A1 library
Property Details
$_name protected_oe property
Specify config name so password gets hashed correctly
(with the right salt pattern) when set in user