<?php namespace App\Models;
/**
 * @author Andy Brookes 
 * @author Andy Brookes <andybrookestar at gmail  dot    com>
 */

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();

}



}
