<?php
// app/Models/DepartmentModel.php

namespace App\Models;
use CodeIgniter\Model;

class FacultyModel extends Model
{
    protected $table = 'faculty';
    protected $primaryKey = 'id';

    protected $allowedFields = [
        'id', 'department_id', 'type', 'name', 'designation', 'registration_no', 'email', 'image', 'publication', 'services', 'created_at','created_by','row_status'
    ];

    public function getFacultyWithDepartment()
    {
        return $this->select('faculty.*, department.department_name')
                    ->join('department', 'faculty.department_id = department.id')
                    ->where('faculty.row_status', 1)
                    ->findAll();
    }
}

?>