Files
nutzwerte_fi4/app/Models/Projekte.php
T

92 lines
2.0 KiB
PHP

<?php
namespace App\Models;
use App\Models\Scopes\KontoScope;
use Illuminate\Database\Eloquent\Model;
class Projekte extends Model
{
protected $fillable = [
'konto_id',
'auftraggeber_id',
'gutachter_id',
'offizieller_name',
'interner_name',
'ort',
'beschreibung',
'erstellung',
'status',
'pdf_gutachten_name',
'pdf_nutzwerte_name',
'excel_nutzwerte_name',
'bezahlt_am',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'bezahlt_am' => 'datetime',
'pdf_nutzwerte_status' => 'boolean',
'pdf_gutachten_status' => 'boolean',
'excel_nutzwerte_status' => 'boolean',
'evaluation_gutachten' => 'boolean',
];
}
protected static function booted(): void
{
static::addGlobalScope(new KontoScope);
}
public function projekt_orientierung_zu_abschlaeges()
{
return $this->hasMany(ProjektOrientierungZuAbschlaege::class);
}
public function auftraggeber()
{
return $this->belongsTo(Auftraggeber::class);
}
public function projekt_platzhalters()
{
return $this->hasMany(ProjektPlatzhalter::class);
}
public function gutachter()
{
return $this->belongsTo(Gutachter::class);
}
public function projekt_allgemeinflaechens()
{
return $this->hasMany(ProjektAllgemeinflaechen::class);
}
public function projekt_raeumealles()
{
return $this->hasMany(ProjektRaeumealle::class);
}
public function projekt_methodes()
{
return $this->hasMany(ProjektMethode::class);
}
public function projekt_inhaltsverzeichnis()
{
return $this->hasMany(ProjektInhaltsverzeichnis::class);
}
public function konto_textblocks()
{
return $this->hasMany(KontoTextblock::class);
}
}