From 02f271cf18dbc44e67dc67087946c4d07158d1c6 Mon Sep 17 00:00:00 2001 From: REJack Date: Mon, 31 Dec 2018 18:40:59 +0000 Subject: [PATCH] added dbReturnType --- app/Config/Aauth.php | 10 ++++++++++ app/Models/Aauth/GroupModel.php | 1 + app/Models/Aauth/PermModel.php | 1 + app/Models/Aauth/UserModel.php | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Config/Aauth.php b/app/Config/Aauth.php index 90a0721..6e8aff1 100644 --- a/app/Config/Aauth.php +++ b/app/Config/Aauth.php @@ -292,6 +292,15 @@ class Aauth extends BaseConfig | The configuration database profile (defined in Config/Database.php) | (default: 'default') | + | 'dbReturnType' + | + | The format that the results should be returned as, for any get* & + | list* function. (e.g. getUser, listUsers, ...). + | Available types: + | - array + | - object + | (default: 'array') + | | 'dbTableUsers' | | The table which contains users @@ -366,6 +375,7 @@ class Aauth extends BaseConfig | (default: false) */ public $dbProfile = 'default'; + public $dbReturnType = 'array'; public $dbTableUsers = 'aauth_users'; public $dbTableUserVariables = 'aauth_user_variables'; public $dbTableLoginAttempts = 'aauth_login_attempts'; diff --git a/app/Models/Aauth/GroupModel.php b/app/Models/Aauth/GroupModel.php index 3cc3ebb..8c4edbb 100644 --- a/app/Models/Aauth/GroupModel.php +++ b/app/Models/Aauth/GroupModel.php @@ -64,6 +64,7 @@ class GroupModel extends Model $this->table = $this->config->dbTableGroups; $this->DBGroup = $this->config->dbProfile; $this->tempUseSoftDeletes = $this->config->dbSoftDeleteGroups; + $this->tempReturnType = $this->config->dbReturnType; $this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; diff --git a/app/Models/Aauth/PermModel.php b/app/Models/Aauth/PermModel.php index a8f85c0..ef42ae5 100644 --- a/app/Models/Aauth/PermModel.php +++ b/app/Models/Aauth/PermModel.php @@ -64,6 +64,7 @@ class PermModel extends Model $this->table = $this->config->dbTablePerms; $this->DBGroup = $this->config->dbProfile; $this->tempUseSoftDeletes = $this->config->dbSoftDeletePerms; + $this->tempReturnType = $this->config->dbReturnType; $this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; diff --git a/app/Models/Aauth/UserModel.php b/app/Models/Aauth/UserModel.php index a4bc588..32ee44d 100644 --- a/app/Models/Aauth/UserModel.php +++ b/app/Models/Aauth/UserModel.php @@ -88,7 +88,8 @@ class UserModel extends Model $this->config = $config; $this->table = $this->config->dbTableUsers; $this->DBGroup = $this->config->dbProfile; - $this->tempUseSoftDeletes = $this->config->dbSoftDeleteGroups; + $this->tempUseSoftDeletes = $this->config->dbSoftDeleteUsers; + $this->tempReturnType = $this->config->dbReturnType; $this->validationRules['email'] = 'required|valid_email|is_unique[' . $this->table . '.email]'; $this->validationRules['password'] = 'required|min_length[' . $this->config->passwordMin . ']|max_length[' . $this->config->passwordMax . ']';