mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Refactor models.
This commit is contained in:
@@ -37,20 +37,13 @@ class RecurrenceMeta extends Model
|
||||
|
||||
protected $fillable = ['recurrence_id', 'name', 'value'];
|
||||
|
||||
protected $table = 'recurrences_meta';
|
||||
protected $table = 'recurrences_meta';
|
||||
|
||||
public function recurrence(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Recurrence::class);
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -61,4 +54,11 @@ class RecurrenceMeta extends Model
|
||||
'value' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user