2025-11-26 13:41:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Model;
|
|
|
|
|
|
2026-03-05 10:22:54 +08:00
|
|
|
use Hyperf\Database\Model\Relations\BelongsTo;
|
2025-11-26 13:41:15 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @mixin \App_Model_Platform
|
|
|
|
|
*/
|
|
|
|
|
class Platform extends Model
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The table associated with the model.
|
2026-03-05 10:22:54 +08:00
|
|
|
*
|
2025-11-26 13:41:15 +08:00
|
|
|
* @TODO check if we realy need the platform table, or consider use a virtual model
|
|
|
|
|
*/
|
2025-11-27 16:25:53 +08:00
|
|
|
protected ?string $table = 'platforms';
|
2025-11-26 13:41:15 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*/
|
2026-03-05 10:22:54 +08:00
|
|
|
protected array $fillable = ['developer_id'];
|
2025-11-26 13:41:15 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast to native types.
|
|
|
|
|
*/
|
2026-03-05 10:22:54 +08:00
|
|
|
protected array $casts = ['developer_id' => 'integer'];
|
|
|
|
|
|
|
|
|
|
public function developer(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class, 'developer_id');
|
|
|
|
|
}
|
2025-11-26 13:41:15 +08:00
|
|
|
}
|