<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $county_assembly_id
 * @property integer $county_id
 * @property integer $created_by
 * @property string $county_assembly_name
 * @property string $county_assembly_code
 * @property integer $status
 * @property string $created
 * @property string $modified
 * @property County $county
 * @property User $user
 */
class CountyAssembly extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'county_assembly';

    /**
     * The primary key for the model.
     * 
     * @var string
     */
    protected $primaryKey = 'county_assembly_id';

    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'integer';

    public $timestamps = false;

    /**
     * @var array
     */
    protected $fillable = ['county_id', 'created_by', 'county_assembly_name',
     'county_assembly_code', 'status', 'created', 'modified'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function county()
    {
        return $this->belongsTo('App\Models\County', 'county_id', 'county_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\Models\User', 'created_by', 'user_id');
    }
}
