<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Description of GContentCategory
 *
 * @author Phattharaphon
 */
class GContentCategory extends Model{
    protected $table = 'g_content_category';
    // Define the fillable or guarded properties as needed
    protected $fillable = ['category_ref_id', 'content_id', 'sub_content_id', 'category_id', 'type_id', 'view', 'created_by', 'created_dt', 'modified_by', 'modified_dt'];    

    protected $primaryKey = 'category_ref_id';
    protected $keyType = 'string';

    public function content()
    {
        return $this->belongsTo(GContent::class, 'contentID');
    }

    public function category()
    {
        return $this->belongsTo(GCategory::class, 'categoryID');
    }

    public function categoryType()
    {
        return $this->belongsTo(GCategoryType::class, 'categoryTypeID');
    }
}
