| 1 | <?php namespace Arcanedev\Support\Traits; |
||
| 9 | trait PrefixedModel |
||
| 10 | { |
||
| 11 | /* ------------------------------------------------------------------------------------------------ |
||
| 12 | | Properties |
||
| 13 | | ------------------------------------------------------------------------------------------------ |
||
| 14 | */ |
||
| 15 | /** |
||
| 16 | * The table prefix. |
||
| 17 | * |
||
| 18 | * @var string|null |
||
| 19 | */ |
||
| 20 | protected $prefix; |
||
| 21 | |||
| 22 | /* ------------------------------------------------------------------------------------------------ |
||
| 23 | | Getters & Setters |
||
| 24 | | ------------------------------------------------------------------------------------------------ |
||
| 25 | */ |
||
| 26 | /** |
||
| 27 | * Get the table associated with the model. |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | 16 | public function getTable() |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Get the prefix table associated with the model. |
||
| 38 | * |
||
| 39 | * @return null|string |
||
| 40 | */ |
||
| 41 | 16 | public function getPrefix() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Set the prefix table associated with the model. |
||
| 48 | * |
||
| 49 | * @param string $prefix |
||
| 50 | * |
||
| 51 | * @return self |
||
| 52 | */ |
||
| 53 | 8 | public function setPrefix($prefix) |
|
| 59 | |||
| 60 | /* ------------------------------------------------------------------------------------------------ |
||
| 61 | | Check Functions |
||
| 62 | | ------------------------------------------------------------------------------------------------ |
||
| 63 | */ |
||
| 64 | /** |
||
| 65 | * Check if table is prefixed. |
||
| 66 | * |
||
| 67 | * @return bool |
||
| 68 | */ |
||
| 69 | 16 | public function isPrefixed() |
|
| 73 | } |
||
| 74 |