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,20 +3,16 @@
namespace App\Models;
use CodeIgniter\Database\ResultInterface;
use CodeIgniter\Model;
use Config\OSPOS;
use stdClass;
/**
* Tax Code class
*/
class Tax_code extends Model
class Tax_code extends BaseModel
{
protected $table = 'tax_codes';
protected $primaryKey = 'tax_code_id';
protected $useAutoIncrement = true;
protected $useSoftDeletes = false;
protected $allowedFields = [
protected string $table = 'tax_codes';
protected string $primaryKey = 'tax_code_id';
protected bool $useAutoIncrement = true;
protected bool $useSoftDeletes = false;
protected array $allowedFields = [
'tax_code',
'tax_code_name',
'city',