54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Imunizacao;
|
|
|
|
use App\Models\Cadastro\SujeitoAtencao\Lotacao;
|
|
use App\Models\Cadastro\Vacina;
|
|
use App\Models\Model;
|
|
|
|
class SaidaVacina extends Model
|
|
{
|
|
protected $table = 'imunizacao_saida_vacina';
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'saida_id',
|
|
'entrada_vacina_id',
|
|
'requisicao_vacina_id',
|
|
'vacina_id',
|
|
'quantidade',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function saida()
|
|
{
|
|
return $this->belongsTo(Saida::class);
|
|
}
|
|
|
|
public function entradaVacinaOrigem()
|
|
{
|
|
return $this->belongsTo(EntradaVacina::class, 'entrada_vacina_id');
|
|
}
|
|
|
|
public function entradaVacinaDestino()
|
|
{
|
|
return $this->hasOne(EntradaVacina::class);
|
|
}
|
|
|
|
public function vacina()
|
|
{
|
|
return $this->belongsTo(Vacina::class, 'vacina_id');
|
|
}
|
|
|
|
public function lotacao() {
|
|
return $this->belongsTo(Lotacao::class, 'updated_lotacao_id');
|
|
}
|
|
}
|