mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-23 03:05:00 -04:00
refactor: Add getters for protected model properties
- Create BaseModel with getters for $table, $primaryKey, $allowedFields - All models now extend BaseModel instead of CodeIgniter\Model - Add type declarations to protected properties Closes #4489
This commit is contained in:
1 parent
905b58ca6e
commit
e17e85bc4c
29 files changed
+194
-304
No files matched your search
+6
-10
@@ -3,18 +3,14 @@
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Database\ResultInterface;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
/**
|
||||
* Module class
|
||||
*/
|
||||
class Module extends Model
|
||||
class Module extends BaseModel
|
||||
{
|
||||
protected $table = 'modules';
|
||||
protected $primaryKey = 'module_id';
|
||||
protected $useAutoIncrement = false;
|
||||
protected $useSoftDeletes = false;
|
||||
protected $allowedFields = [
|
||||
protected string $table = 'modules';
|
||||
protected string $primaryKey = 'module_id';
|
||||
protected bool $useAutoIncrement = false;
|
||||
protected bool $useSoftDeletes = false;
|
||||
protected array $allowedFields = [
|
||||
'name_lang_key',
|
||||
'desc_lang_key',
|
||||
'sort'
|
||||
|
||||
Reference in new issue
Block a user