This commit is contained in:
53
api/app/Models/Imunizacao/SaidaVacina.php
Normal file
53
api/app/Models/Imunizacao/SaidaVacina.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user