<?php

namespace App\Models;

use CodeIgniter\Model;

class GudangModel extends Model
{
    protected $table = 'gudang';
    protected $primaryKey = 'id';
    protected $allowedFields = ['nama']; 

    // Ambil semua gudang
    public function getAll()
    {
        return $this->findAll();
    }

    // Ambil nama gudang berdasarkan ID
    public function getNamaById($id)
    {
        return $this->select('nama')->where('id', $id)->first();
    }
}
