<?php namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Model;

class UserModel extends Model 

{
protected $limit;
protected $offset;

protected $table      = 'admin';
protected $primaryKey = 'Id';
protected $allowedFields = ['Name','Password','Role'];



public function getUser()

{
$this->limit=1;
 return $this->findAll($this->limit);
                     

}

public function getOne($role)

{
 return $this->asArray()
                     ->where(['Role' => $role])
                     ->first();

}



}
