<?php

namespace App\Models;

use CodeIgniter\Model;

class MenuTypeModel extends Model
{
    use \App\Models\Traits\Auditable;

    protected $table         = 'menu_type';
    protected $primaryKey    = 'mt_idx';
    protected $returnType    = 'object';
    protected $useTimestamps = false;
    protected $allowedFields = ['mt_code', 'mt_name', 'mt_sort'];

    public function getByCode(string $code): ?object
    {
        return $this->where('mt_code', $code)->first();
    }
}
