bristol-su /
upload-file
| 1 | <?php |
||
| 2 | |||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 3 | |||
| 4 | namespace BristolSU\Module\UploadFile\Models; |
||
| 5 | |||
| 6 | |||
| 7 | use BristolSU\ControlDB\Contracts\Repositories\User as UserRepository; |
||
| 8 | use BristolSU\Support\Revision\HasRevisions; |
||
| 9 | use Illuminate\Database\Eloquent\Model; |
||
| 10 | use Illuminate\Database\Eloquent\SoftDeletes; |
||
| 11 | |||
| 12 | class FileStatus extends Model |
||
|
0 ignored issues
–
show
|
|||
| 13 | { |
||
| 14 | use SoftDeletes, HasRevisions; |
||
|
0 ignored issues
–
show
The trait
BristolSU\Support\Revision\HasRevisions requires some properties which are not provided by BristolSU\Module\UploadFile\Models\FileStatus: $revisionNullString, $revisionEnabled, $revisionFormattedFields, $keepRevisionOf, $revisionUnknownString, $revisionFormattedFieldNames, $revisionCreationsEnabled, $softDelete
Loading history...
|
|||
| 15 | |||
| 16 | protected $table = 'uploadfile_file_statuses'; |
||
| 17 | |||
| 18 | protected $fillable = [ |
||
| 19 | 'file_id', 'status', 'created_by' |
||
| 20 | ]; |
||
| 21 | |||
| 22 | 1 | public function file() |
|
|
0 ignored issues
–
show
|
|||
| 23 | { |
||
| 24 | 1 | return $this->belongsTo(File::class); |
|
| 25 | } |
||
| 26 | |||
| 27 | 5 | public function getCreatedByAttribute($createdById) |
|
|
0 ignored issues
–
show
|
|||
| 28 | { |
||
| 29 | 5 | return app()->make(UserRepository::class)->getById($createdById); |
|
| 30 | } |
||
| 31 | |||
| 32 | } |