<?php

namespace App\Models\Movie;

use Illuminate\Database\Eloquent\Model;

class MovieInfo extends Model
{
    protected $table = 'tb_movie_info';
    protected $primaryKey = 'id';

    public $keyType = 'int';
    public $incrementing = true;
    public $timestamps = true;

    const CREATED_AT = 'created_at';
    const UPDATED_AT = 'updated_at';
    const DELETED_AT = null;

    protected $guarded = [];

    public function info(string $movieCd): MovieInfo
    {
        return $this->where('movie_cd', $movieCd)->firstOrNew();
    }
}
