mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Clean up code.
This commit is contained in:
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -32,14 +33,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionJournalLink
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int $link_type_id
|
||||
* @property int $link_type_id
|
||||
* @property int $source_id
|
||||
* @property int $destination_id
|
||||
* @property string|null $comment
|
||||
@@ -131,6 +132,17 @@ class TransactionJournalLink extends Model
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class, 'source_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -150,13 +162,4 @@ class TransactionJournalLink extends Model
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user