mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-29 10:47:53 -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:
@@ -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