<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\Database\Model\Relations\BelongsTo;

/**
 * @mixin \App_Model_Platform
 */
class Platform extends Model
{
    /**
     * The table associated with the model.
     *
     * @TODO check if we realy need the platform table, or consider use a virtual model
     */
    protected ?string $table = 'platforms';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['developer_id'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['developer_id' => 'integer'];

    public function developer(): BelongsTo
    {
        return $this->belongsTo(User::class, 'developer_id');
    }
}
