<?php

namespace App\Models\Content;

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

class ContentAssignment extends Model
{
	use SoftDeletes;
    protected $table='content_assignment';
    protected $primaryKey = 'id';
    protected $fillable = ['content_id','organisation_id','department_id','section_id','material_type_id','material_subtype_id','topic_id'];
    
   
    function contentname()
    {
        return $this->belongsTo('\App\Models\Content\Content','content_id','id');
    }
    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 topic()
    {
        return $this->belongsTo('\App\Models\Settings\Topic','topic_id','id');
    }
    function department()
    {
        return $this->belongsTo('\App\Models\Settings\Department','department_id','id');
    }
    function section()
    {
        return $this->belongsTo('\App\Models\Settings\Section','section_id','id');
    }

}
