Files
nutzwerte_fi4/app/Models/ProjektObjekteImDetail.php
2026-09-17 08:35:36 +02:00

60 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $projekte_id
* @property int $projekt_objekte_id
* @property int $projekt_methode_id
* @property int $cloned_from_id
* @property int $added_manuel
* @property int $methode_id
* @property int $top_nummer
* @property string $geschoss
* @property string $raumart
* @property float $flaeche
* @property int $nutzwert
*/
class ProjektObjekteImDetail extends Model
{
protected $fillable = [
'projekte_id',
'projekt_objekte_id',
'projekt_methode_id',
'cloned_from_id',
'added_manuel',
'methode_id',
'top_nummer',
'geschoss',
'raumart',
'faktor',
'flaeche',
'nutzwert',
'added_manuel',
];
public static function boot()
{
parent::boot();
self::updated(function ($model) {
Projekte::where('id', $model['projekte_id'])->update([
'evaluation_gutachten' => false,
]);
});
}
public function top_nummer()
{
return $this->belongsTo(ProjektObjekte::class, 'projekt_objekte_id', 'id');
}
public function methode()
{
return $this->belongsTo(ProjektMethode::class, 'projekt_methode_id', 'id');
}
}