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:
Ollama
2026-04-15 12:40:24 +00:00
parent 905b58ca6e
commit e17e85bc4c
29 changed files with 194 additions and 304 deletions

View File

@@ -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'