<?php

namespace App\Models\Referensi;

use App\Models\BaseModel;

class PdkunitModel extends BaseModel
{
    protected $table            = 'pdk_unit';
    protected $primaryKey       = 'id';
    protected $allowedFields    = ['nama_unit', 'nama_sunit'];

    public function find_by_id($id)
    {
        $db = \Config\Database::connect();
        $builder = $db->table($this->table);

        //$builder->join('table2', 'table2.fk = pdk_unit.fk');
        $builder->where('id', $id);

        return $builder->get()->getRow();
    }
}