<?php

namespace App\Models;

use CodeIgniter\Model;

class ProductModel extends Model
{
    protected $table      = 'tbl_product';
    protected $primaryKey = 'ID';

    protected $allowedFields = [
        'productName',
        'productSize',
        'productThicknes',
        'productFaceVeneer',
        'productResin',
        'productGrade',
        'productPhoto',
        'created_at',
        'updated_at',
    ];

    protected $useTimestamps = true;

    public function getByID($id)
    {
        return $this->where('ID', $id)->first();
    }

    public function totalCount(){
        return $this->countAll();
    }
}
