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

48 lines
977 B
PHP

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