43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* @property string $id
|
|
* @property int|null $owner_user_id
|
|
* @property string|null $organization_id
|
|
* @property string|null $anonymous_token_hash
|
|
* @property string $status
|
|
* @property int $version_no
|
|
* @property array<string, mixed> $input_snapshot
|
|
* @property array<string, mixed>|null $result_snapshot
|
|
*/
|
|
class Simulation extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
public $incrementing = false;
|
|
|
|
protected $keyType = 'string';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $casts = ['input_snapshot' => 'array', 'result_snapshot' => 'array', 'calculation_snapshot' => 'array'];
|
|
|
|
/** @return HasMany<SimulationScenario, $this> */
|
|
public function scenarios(): HasMany
|
|
{
|
|
return $this->hasMany(SimulationScenario::class);
|
|
}
|
|
|
|
/** @return HasMany<SimulationReport, $this> */
|
|
public function reports(): HasMany
|
|
{
|
|
return $this->hasMany(SimulationReport::class);
|
|
}
|
|
}
|