This commit is contained in:
68
api/app/Models/ExameImagem/Parametrizacao.php
Normal file
68
api/app/Models/ExameImagem/Parametrizacao.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\ExameImagem\Parametrizacao\Ocupacao;
|
||||
use App\Models\ExameImagem\Parametrizacao\ParametrizacaoUnidadeSms;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_unidade';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'unidade_id',
|
||||
'executante',
|
||||
'prestador',
|
||||
'infraestrutura_id',
|
||||
'envia_sms',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'executante' => 'boolean',
|
||||
'prestador' => 'boolean',
|
||||
'envia_sms' => 'boolean',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(Ocupacao::class);
|
||||
}
|
||||
|
||||
public function sms()
|
||||
{
|
||||
return $this->hasOne(ParametrizacaoUnidadeSms::class, 'parametrizacao_unidade_id');
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user