<?php

namespace App\Models;

use PDO;
use Config\Database;

class Notification extends BaseModel
{
    protected static $table = 'notifications';

    public $id;
    public $user_id;
    public $group_id;
    public $subgroup_id;
    public $process_id;
    public $message;
    public $is_read;
    public $created_at;

    public function __construct($data = [])
    {
        parent::__construct($data);
    }

    public function user()
    {
        return User::find($this->user_id);
    }

    public function group()
    {
        return Group::find($this->group_id);
    }

    public function subgroup()
    {
        return Subgroup::find($this->subgroup_id);
    }

    public function process()
    {
        return Process::find($this->process_id);
    }
}