<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class XM_Confi extends Model
{
    protected $table = 'XM_confi';
    protected $connection = 'escolar';
    protected $fillable = ['periodo_id','inicio', 'cierre', 'estado', 'publicar'];
    protected $dates = [ 'inicio', 'cierre' ];

    public function xmSocioConfi(){
        return $this->hasOne('App\XM_SocioeconomicoConfi', 'confi_id', 'id');
    }

    public function xmMensajes(){
        return $this->hasOne('App\XM_Mensajes', 'confi_id', 'id');
    }

    public function xmIngreso(){
        return $this->hasMany('App\XM_Ingreso', 'confi_id', 'id');
    }

    public function periodo(){
        return $this->belongsTo('App\RFPeriodo', 'periodo_id', 'id');
    }
}
