<?php

namespace App\Models;

use CodeIgniter\Model;

class AgentModel extends Model
{

  protected $table = 'agent';
  protected $allowedFields = [
      'name',
      'email',
      'password',
      'status',
      'created_at',
      'updated_at'
  ];

  public function getAgents($id = false)
  {
    if ($id === false) {
      return $this->findAll();
    }

    return $this->where(['id' => $id])->first();
  }
  
  
}
