malekbenelouafi /
laravel-status
| 1 | <?php |
||||
| 2 | namespace Malekbenelouafi\LaravelStatus; |
||||
| 3 | use Malekbenelouafi\LaravelStatus\Scopes\StatusScope; |
||||
| 4 | |||||
| 5 | trait HasStatus |
||||
| 6 | { |
||||
| 7 | |||||
| 8 | /** |
||||
| 9 | * Boot the Active Events trait for a model. |
||||
| 10 | * |
||||
| 11 | * @return void |
||||
| 12 | */ |
||||
| 13 | public static function bootHasStatus() |
||||
| 14 | { |
||||
| 15 | static::addGlobalScope(new StatusScope); |
||||
| 16 | } |
||||
| 17 | |||||
| 18 | |||||
| 19 | /** |
||||
| 20 | * Get the name of the "deleted at" column. |
||||
| 21 | * |
||||
| 22 | * @return string |
||||
| 23 | */ |
||||
| 24 | public function getStatusColumn() |
||||
| 25 | { |
||||
| 26 | return defined('static::STATUS') ? static::STATUS : 'status'; |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 27 | } |
||||
| 28 | |||||
| 29 | /** |
||||
| 30 | * Get the fully qualified "deleted at" column. |
||||
| 31 | * |
||||
| 32 | * @return string |
||||
| 33 | */ |
||||
| 34 | public function getQualifiedStatusColumn() |
||||
| 35 | { |
||||
| 36 | return $this->qualifyColumn($this->getStatusColumn()); |
||||
|
0 ignored issues
–
show
It seems like
qualifyColumn() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 37 | } |
||||
| 38 | |||||
| 39 | } |
||||
| 40 |