| 1 | <?php |
||
| 14 | abstract class PrefixedModel extends Model |
||
| 15 | { |
||
| 16 | /* ----------------------------------------------------------------- |
||
| 17 | | Properties |
||
| 18 | | ----------------------------------------------------------------- |
||
| 19 | */ |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The table prefix. |
||
| 23 | * |
||
| 24 | * @var string|null |
||
| 25 | */ |
||
| 26 | protected $prefix; |
||
| 27 | |||
| 28 | /* ----------------------------------------------------------------- |
||
| 29 | | Getters & Setters |
||
| 30 | | ----------------------------------------------------------------- |
||
| 31 | */ |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get the table associated with the model. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 12 | public function getTable() |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Get the prefix table associated with the model. |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 12 | public function getPrefix(): string |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Set the prefix table associated with the model. |
||
| 55 | * |
||
| 56 | * @param string|null $prefix |
||
| 57 | * |
||
| 58 | * @return $this |
||
| 59 | */ |
||
| 60 | 6 | public function setPrefix(?string $prefix) |
|
| 66 | |||
| 67 | /* ----------------------------------------------------------------- |
||
| 68 | | Check Methods |
||
| 69 | | ----------------------------------------------------------------- |
||
| 70 | */ |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Check if table is prefixed. |
||
| 74 | * |
||
| 75 | * @return bool |
||
| 76 | */ |
||
| 77 | 12 | public function isPrefixed(): bool |
|
| 81 | } |
||
| 82 |