2024-08-29 15:46:10 -04:00
|
|
|
<?php
|
|
|
|
|
2025-01-30 00:23:55 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-08-29 15:46:10 -04:00
|
|
|
namespace App\Models;
|
|
|
|
|
2025-01-30 15:44:05 -05:00
|
|
|
use Carbon\Carbon;
|
2024-08-29 15:46:10 -04:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
2025-01-30 15:44:05 -05:00
|
|
|
/**
|
|
|
|
* ModResolvedDependency Model
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $mod_version_id
|
|
|
|
* @property int $dependency_id
|
|
|
|
* @property int $resolved_mod_version_id
|
|
|
|
* @property Carbon|null $created_at
|
|
|
|
* @property Carbon|null $updated_at
|
|
|
|
* @property-read ModVersion|null $modVersion
|
|
|
|
* @property-read ModDependency|null $dependency
|
|
|
|
* @property-read ModVersion|null $resolvedModVersion
|
|
|
|
*/
|
2024-08-29 15:46:10 -04:00
|
|
|
class ModResolvedDependency extends Model
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The relationship between the resolved dependency and the mod version.
|
2024-09-12 13:19:52 -04:00
|
|
|
*
|
2025-01-30 15:44:05 -05:00
|
|
|
* @return BelongsTo<ModVersion, $this>
|
2024-08-29 15:46:10 -04:00
|
|
|
*/
|
|
|
|
public function modVersion(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(ModVersion::class, 'mod_version_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The relationship between the resolved dependency and the dependency.
|
2024-09-12 13:19:52 -04:00
|
|
|
*
|
2025-01-30 15:44:05 -05:00
|
|
|
* @return BelongsTo<ModDependency, $this>
|
2024-08-29 15:46:10 -04:00
|
|
|
*/
|
|
|
|
public function dependency(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(ModDependency::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The relationship between the resolved dependency and the resolved mod version.
|
2024-09-12 13:19:52 -04:00
|
|
|
*
|
2025-01-30 15:44:05 -05:00
|
|
|
* @return BelongsTo<ModVersion, $this>
|
2024-08-29 15:46:10 -04:00
|
|
|
*/
|
|
|
|
public function resolvedModVersion(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(ModVersion::class, 'resolved_mod_version_id');
|
|
|
|
}
|
2024-10-12 13:18:04 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that should be cast to native types.
|
|
|
|
*/
|
|
|
|
protected function casts(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'created_at' => 'datetime',
|
|
|
|
'updated_at' => 'datetime',
|
|
|
|
];
|
|
|
|
}
|
2024-08-29 15:46:10 -04:00
|
|
|
}
|