mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Various code cleanup.
This commit is contained in:
@@ -23,20 +23,21 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
/**
|
||||
* FireflyIII\Models\TransactionJournalMeta
|
||||
*
|
||||
* @property int|string $id
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int|string $transaction_journal_id
|
||||
* @property int $transaction_journal_id
|
||||
* @property string $name
|
||||
* @property mixed $data
|
||||
* @property string $hash
|
||||
@@ -60,6 +61,7 @@ use Carbon\Carbon;
|
||||
*/
|
||||
class TransactionJournalMeta extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
@@ -103,4 +105,13 @@ class TransactionJournalMeta extends Model
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user