<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 駐輪場モデル - parkテーブル（正式モデル）
 * 旧UsingStatusParkの責務を置き換え
 */
class Park extends Model
{
    protected $table = 'park';
    protected $primaryKey = 'park_id';
    public $timestamps = true;

    public const CREATED_AT = 'created_at';
    public const UPDATED_AT = 'updated_at';

    protected $fillable = [
        'park_name',
        'park_ruby',
        'park_syllabary',
        'park_adrs',
        'park_close_flag',
        'park_day',
        'alert_flag',
        'print_number',
        'keep_alive',
        'city_id',
        'operator_id',
    ];

    /**
     * 料金設定との関連付け
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function prices()
    {
        return $this->hasMany(PriceA::class, 'park_id', 'park_id');
    }
}


