<?php

namespace App\Models\Settings;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Topic extends Model
{
	use SoftDeletes;
    protected $table='topic';
    protected $primaryKey = 'id';
    protected $fillable = ['organisation_id','material_type_id','material_subtype_id','topic_name','remarks'];
    
    function organisation()
    {
        return $this->belongsTo('\App\Models\Settings\Organisation','organisation_id','id');
    }
    function materialtype()
    {
        return $this->belongsTo('\App\Models\Settings\MaterialType','material_type_id','id');
    }
    function materialsubtype()
    {
        return $this->belongsTo('\App\Models\Settings\MaterialSubType','material_subtype_id','id');
    }
    function content_assignment()
    {
        return $this->hasMany('\App\Models\Content\ContentAssignment','topic_id','id');
    }

}
