Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions app/Models/BuildGroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

/**
* @property int $id
* @property string $name
* @property int $projectid
* @property Carbon $starttime
* @property Carbon $endtime
* @property int $autoremovetimeframe
* @property string $description
* @property int $summaryemail
* @property int $includesubprojectotal // Should this be a boolean?
* @property int $emailcommitters // Should this be a boolean?
* @property string $type
*
* @mixin Builder<BuildGroup>
*/
class BuildGroup extends Model
{
protected $table = 'buildgroup';

public $timestamps = false;

protected $fillable = [
'name',
'projectid',
'starttime',
'endtime',
'autoremovetimeframe',
'description',
'summaryemail',
'includesubprojectotal',
'emailcommitters',
'type',
];

protected $casts = [
'id' => 'integer',
'projectid' => 'integer',
'starttime' => 'datetime',
'endtime' => 'datetime',
'autoremovetimeframe' => 'integer',
'summaryemail' => 'integer',
'includesubprojectotal' => 'integer',
'emailcommitters' => 'integer',
];

/**
* @return BelongsTo<Project, self>
*/
public function project(): BelongsTo
{
return $this->belongsTo(Project::class, 'id', 'projectid');
}
}
8 changes: 8 additions & 0 deletions app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,12 @@ public function measurements(): HasMany
{
return $this->hasMany(Measurement::class, 'projectid', 'id');
}

/**
* @return HasMany<BuildGroup>
*/
public function buildgroups(): HasMany
{
return $this->hasMany(BuildGroup::class, 'projectid', 'id');
}
}
Loading