| Total Complexity | 6 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait StatusTrait |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Boot the soft deleting trait for a model. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | 216 | public static function bootStatusTrait() |
|
| 15 | { |
||
| 16 | 216 | static::addGlobalScope(new StatusScope); |
|
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Get a new query builder that only includes offline items. |
||
| 21 | * |
||
| 22 | * @return \Illuminate\Database\Eloquent\Builder|static |
||
| 23 | */ |
||
| 24 | 2 | public static function onlyOffline() |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get a new query builder that include offline and online items. |
||
| 36 | * |
||
| 37 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 38 | */ |
||
| 39 | 4 | public static function offlineAndOnline() |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the fully qualified "deleted at" column. |
||
| 48 | * |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 50 | public function getQualifiedStatusColumn() |
|
| 52 | { |
||
| 53 | 50 | return $this->getTable().'.'.$this->getStatusColumn(); |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get the name of the "deleted at" column. |
||
| 58 | * |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | 50 | public function getStatusColumn() |
|
| 64 | } |
||
| 65 | } |
||
| 66 |