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 committed 2026-04-15 12:40:24 +00:00
1 parent 905b58ca6e
commit e17e85bc4c
29 files changed
+194 -304

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
abstract class BaseModel extends Model
{
public function getTableName(): string
{
return $this->table;
}
public function getPrimaryKeyName(): string
{
return $this->primaryKey;
}
public function getAllowedFields(): array
{
return $this->allowedFields;
}
public function getUseAutoIncrement(): bool
{
return $this->useAutoIncrement;
}
public function getUseSoftDeletes(): bool
{
return $this->useSoftDeletes;
}
}