<?php

namespace App\Models;

use CodeIgniter\Model;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Validation\ValidationInterface;

class WappsiUsersModel extends Model
{
    public function __construct(String $DBGroup = 'wappsi')
    {   
        $this->DBGroup = $DBGroup;
        parent::__construct();
    }
    protected $DBGroup              = 'wappsi';
    protected $table                = 'wappsi_users';
    protected $primaryKey           = 'id';
    protected $useAutoIncrement     = true;
    protected $insertID             = 0;
    protected $returnType           = 'array';
    protected $useSoftDeletes       = false;
    protected $protectFields        = true;

    // // fields
    // protected $username;
    // protected $password;

    protected $allowedFields        = [
        "username",
        "password",
        "email",
        "host_url",
        "jwt_key",
        "company_folder",
        "user_data_id",
        "jwt_key",
        "status",
        "login_status",
        "db_group"
    ];

    protected $allowedFieldsToApp        = [
        "username",
        "password",
        "email",
        "host_url",
        "jwt_key",
        "company_folder",
        "user_data_id",
        "jwt_key",
        "status",
        "login_status",
        "db_group"
    ];

    // Dates
    protected $useTimestamps        = false;
    protected $dateFormat           = 'datetime';
    protected $createdField         = 'created_at';
    protected $updatedField         = 'updated_at';
    protected $deletedField         = 'deleted_at';

    // Validation
    protected $validationRules      = [];
    protected $validationMessages   = [];
    protected $skipValidation       = false;
    protected $cleanValidationRules = true;

    // Callbacks
    protected $allowCallbacks       = true;
    protected $beforeInsert         = [];
    protected $afterInsert          = [];
    protected $beforeUpdate         = [];
    protected $afterUpdate          = [];
    protected $beforeFind           = [];
    protected $afterFind            = [];
    protected $beforeDelete         = [];
    protected $afterDelete          = [];
}
