File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 22
33namespace CodeIgniter \Shield \Models ;
44
5- use CodeIgniter \Database \BaseResult ;
65use CodeIgniter \I18n \Time ;
76use CodeIgniter \Model ;
87use CodeIgniter \Shield \Entities \Login ;
1110
1211class LoginModel extends Model
1312{
13+ use CheckQueryReturnTrait;
14+
1415 protected $ table = 'auth_logins ' ;
1516 protected $ primaryKey = 'id ' ;
1617 protected $ returnType = Login::class;
@@ -36,24 +37,24 @@ class LoginModel extends Model
3637
3738 /**
3839 * @param int|string|null $userId
39- *
40- * @return BaseResult|false|int|object|string
4140 */
4241 public function recordLoginAttempt (
4342 string $ identifier ,
4443 bool $ success ,
4544 ?string $ ipAddress = null ,
4645 ?string $ userAgent = null ,
4746 $ userId = null
48- ) {
49- return $ this ->insert ([
47+ ): void {
48+ $ return = $ this ->insert ([
5049 'ip_address ' => $ ipAddress ,
5150 'user_agent ' => $ userAgent ,
5251 'identifier ' => $ identifier ,
5352 'user_id ' => $ userId ,
5453 'date ' => date ('Y-m-d H:i:s ' ),
5554 'success ' => (int ) $ success ,
5655 ]);
56+
57+ $ this ->checkQueryReturn ($ return );
5758 }
5859
5960 /**
You can’t perform that action at this time.
0 commit comments