mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-29 10:47:53 -04:00
- 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
33 lines
569 B
PHP
33 lines
569 B
PHP
<?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;
|
|
}
|
|
} |