2025-12-29 21:53:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Database\Factories\ScenarioFactory;
|
2025-12-31 00:02:54 +01:00
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
2025-12-29 21:53:52 +01:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
|
|
2025-12-31 00:02:54 +01:00
|
|
|
/**
|
2025-12-31 02:34:30 +01:00
|
|
|
* @property int $id
|
2025-12-31 00:02:54 +01:00
|
|
|
* @property Collection<Bucket> $buckets
|
|
|
|
|
* @method static create(array $data)
|
|
|
|
|
*/
|
2025-12-29 21:53:52 +01:00
|
|
|
class Scenario extends Model
|
|
|
|
|
{
|
|
|
|
|
/** @use HasFactory<ScenarioFactory> */
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
2025-12-31 00:02:54 +01:00
|
|
|
'description',
|
2025-12-29 21:53:52 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function buckets(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Bucket::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function streams(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Stream::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function inflows(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Inflow::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function outflows(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Outflow::class);
|
|
|
|
|
}
|
|
|
|
|
}
|