Files
vkv/app/Models/Log.php
Zdeněk Burda 41e3ce6f25 Initial commit
2026-01-09 21:26:40 +01:00

117 lines
2.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\PowerCategory;
class Log extends Model
{
use HasFactory;
protected $table = 'logs';
protected $fillable = [
'round_id',
'file_id',
'accepted',
'processed',
'ip_address',
'tname',
'tdate',
'pcall',
'pwwlo',
'pexch',
'psect',
'pband',
'pclub',
'padr1',
'padr2',
'rname',
'rcall',
'rcoun',
'locator',
'radr1',
'radr2',
'rpoco',
'rcity',
'rphon',
'rhbbs',
'mope1',
'mope2',
'stxeq',
'srxeq',
'sante',
'santh',
'power_watt',
'power_category',
'power_category_id',
'sixhr_category',
'claimed_qso_count',
'claimed_score',
'claimed_wwl',
'claimed_dxcc',
'cqsos',
'cqsop',
'cwwls',
'cwwlb',
'cexcs',
'cexcb',
'cdxcs',
'cdxcb',
'ctosc',
'codxc',
'remarks',
'remarks_eval',
'raw_header',
];
protected $casts = [
'round_id' => 'integer',
'file_id' => 'integer',
'accepted' => 'boolean',
'processed' => 'boolean',
'power_watt' => 'float',
'power_category_id' => 'integer',
'sixhr_category' => 'boolean',
'claimed_qso_count' => 'integer',
'claimed_score' => 'integer',
];
public function round(): BelongsTo
{
return $this->belongsTo(Round::class);
}
public function file(): BelongsTo
{
return $this->belongsTo(File::class);
}
public function qsos(): HasMany
{
return $this->hasMany(LogQso::class);
}
public function logResults(): HasMany
{
return $this->hasMany(LogResult::class);
}
public function powerCategory(): BelongsTo
{
return $this->belongsTo(PowerCategory::class);
}
}