Initial commit
This commit is contained in:
70
app/Models/LogOverride.php
Normal file
70
app/Models/LogOverride.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class LogOverride extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'log_overrides';
|
||||
|
||||
protected $fillable = [
|
||||
'evaluation_run_id',
|
||||
'log_id',
|
||||
'forced_log_status',
|
||||
'forced_band_id',
|
||||
'forced_category_id',
|
||||
'forced_power_category_id',
|
||||
'forced_sixhr_category',
|
||||
'forced_power_w',
|
||||
'reason',
|
||||
'context',
|
||||
'created_by_user_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'evaluation_run_id' => 'integer',
|
||||
'log_id' => 'integer',
|
||||
'forced_band_id' => 'integer',
|
||||
'forced_category_id' => 'integer',
|
||||
'forced_power_category_id' => 'integer',
|
||||
'forced_sixhr_category' => 'boolean',
|
||||
'forced_power_w' => 'integer',
|
||||
'context' => 'array',
|
||||
'created_by_user_id' => 'integer',
|
||||
];
|
||||
|
||||
public function evaluationRun(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EvaluationRun::class);
|
||||
}
|
||||
|
||||
public function log(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Log::class);
|
||||
}
|
||||
|
||||
public function forcedBand(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Band::class, 'forced_band_id');
|
||||
}
|
||||
|
||||
public function forcedCategory(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class, 'forced_category_id');
|
||||
}
|
||||
|
||||
public function forcedPowerCategory(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PowerCategory::class, 'forced_power_category_id');
|
||||
}
|
||||
|
||||
public function createdByUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by_user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user