2024-07-26 02:19:42 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2024-08-01 17:15:02 -04:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2024-07-26 02:19:42 -04:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property int $id
|
|
|
|
* @property int $mod_version_id
|
|
|
|
* @property int $dependency_mod_id
|
|
|
|
* @property string $version_constraint
|
|
|
|
* @property int|null $resolved_version_id
|
|
|
|
*/
|
|
|
|
class ModDependency extends Model
|
|
|
|
{
|
2024-08-01 17:15:02 -04:00
|
|
|
use HasFactory;
|
|
|
|
|
2024-07-26 02:19:42 -04:00
|
|
|
/**
|
|
|
|
* The relationship between a mod dependency and mod version.
|
|
|
|
*/
|
|
|
|
public function modVersion(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(ModVersion::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-08-22 17:04:07 -04:00
|
|
|
* The relationship between the mod dependency and the mod that is depended on.
|
2024-07-26 02:19:42 -04:00
|
|
|
*/
|
|
|
|
public function dependencyMod(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Mod::class, 'dependency_mod_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The relationship between a mod dependency and resolved mod version.
|
|
|
|
*/
|
|
|
|
public function resolvedVersion(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(ModVersion::class, 'resolved_version_id');
|
|
|
|
}
|
|
|
|
}
|