This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\FormulaExame;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Dyrynda\Database\Support\CascadeSoftDeletes;
|
||||
use App\Models\ExameLaboratorial\FormulaExame\FormulaExameFator;
|
||||
|
||||
class FormulaExame extends Model
|
||||
{
|
||||
use SoftDeletes, CascadeSoftDeletes;
|
||||
|
||||
protected $table = 'exame_laboratorial_formula_exame';
|
||||
|
||||
protected $cascadeDeletes = [
|
||||
'FormulaExame'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'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 FormulaExame()
|
||||
{
|
||||
return $this->hasMany(FormulaExameFator::class, 'formula_exame_id');
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\FormulaExame;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\ExameLaboratorial\FormulaExame\Operacao;
|
||||
|
||||
class FormulaExameFator extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_laboratorial_formula_exame_fator';
|
||||
|
||||
protected $fillable = [
|
||||
'formula_exame_id',
|
||||
'fator',
|
||||
'operacao_id',
|
||||
'tipo',
|
||||
'valor',
|
||||
'exponenciacao',
|
||||
'exponenciacao_tipo',
|
||||
'exponenciacao_valor',
|
||||
'ordem',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'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 operacao()
|
||||
{
|
||||
return $this->belongsTo(Operacao::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
api/app/Models/ExameLaboratorial/FormulaExame/Operacao.php
Normal file
19
api/app/Models/ExameLaboratorial/FormulaExame/Operacao.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\FormulaExame;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Operacao extends Model
|
||||
{
|
||||
protected $table = 'exame_laboratorial_formula_exame_operacao';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user