init backend presensi

This commit is contained in:
mwpn
2026-03-05 14:37:36 +07:00
commit b4fda6b9c9
319 changed files with 27261 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Modules\Auth\Models;
use App\Modules\Auth\Entities\Role;
use CodeIgniter\Model;
/**
* Role Model
*/
class RoleModel extends Model
{
protected $table = 'roles';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = Role::class;
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'role_code',
'role_name',
];
protected $useTimestamps = false;
protected $validationRules = [
'role_code' => 'required|max_length[50]|is_unique[roles.role_code,id,{id}]',
'role_name' => 'required|max_length[100]',
];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
public function findByCode(string $code): ?Role
{
return $this->where('role_code', $code)->first();
}
}