<?php

namespace App\Entities;

use CodeIgniter\Entity;

class SysUserEntity extends Entity
{
	protected $datamap = [
        "user_access_id" => "user_access_id", 
        "name" => "name", 
        "title" => "title", 
        "email" => "email", 
        "user_id" => "user_id", 
        "pswrd" => "pswrd", 
        "is_active" => "is_active", 
        "created_date" => "created_date",
        "created_by" => "created_by",
        "modified_date" => "modified_date",
        "modified_by" => "modified_by",
        "deleted_date" => "deleted_date",
        "deleted_by" => "deleted_by",
	];

	protected $dates = [];
    
	protected $casts = [];		

    public function setIsactive($value)
    {
        if($value == "on" || $value == "YES") {
            $ret = "YES";
        } else {
            $ret = "NO";
        }
        $this->attributes["is_active"] = $ret;
        return $this;
    }	

    public function getIsactive()
    {
        $ret = null;
        if(array_key_exists("is_active", $this->attributes)) {
            $attribute = $this->attributes["is_active"];
            if($attribute == "on" || $attribute == "YES") {
                $ret = "YES";
            }
        }
        return $ret;
    }
}
