<?php

namespace App\Models;

use CodeIgniter\Model;

class UserModel extends Model
{
    protected $table = 'user';
    protected $primaryKey = 'id';
    protected $allowedFields = ['email', 'password', 'role', 'nama'];
    protected $useTimestamps = false;

    // Ambil user berdasarkan email
    public function getByEmail($email)
    {
        return $this->where('email', $email)->first();
    }
}
