<?php

namespace App\Models\Content;

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

class Content extends Model
{
	use SoftDeletes;
    protected $table='content';
    protected $primaryKey = 'id';
    protected $fillable = ['organisation_id','content_type_id','content_subject','description','created_by','updated_by'];
    
    function organisation()
    {
        return $this->belongsTo('\App\Models\Settings\Organisation','organisation_id','id');
    }
    function content_type()
    {
        return $this->belongsTo('\App\Models\Settings\ContentType','content_type_id','id');
    }
    function content_assignment()
    {
        return $this->hasMany('\App\Models\Content\ContentAssignment','content_id','id');
    }
    function content_document()
    {
        return $this->hasMany('\App\Models\Content\ContentDocument','content_id','id');
    }
}
