mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 03:56:42 +00:00
chore: reformat code.
This commit is contained in:
@@ -37,31 +37,31 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
/**
|
||||
* FireflyIII\Models\Transaction
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $id
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||
* @property bool $reconciled
|
||||
* @property int $account_id
|
||||
* @property int $transaction_journal_id
|
||||
* @property string|null $description
|
||||
* @property int|null $transaction_currency_id
|
||||
* @property string $modified
|
||||
* @property string $modified_foreign
|
||||
* @property string $date
|
||||
* @property string $max_date
|
||||
* @property string $amount
|
||||
* @property string|null $foreign_amount
|
||||
* @property int|null $foreign_currency_id
|
||||
* @property int $identifier
|
||||
* @property-read Account $account
|
||||
* @property-read Collection|Budget[] $budgets
|
||||
* @property-read int|null $budgets_count
|
||||
* @property-read Collection|Category[] $categories
|
||||
* @property-read int|null $categories_count
|
||||
* @property-read TransactionCurrency|null $foreignCurrency
|
||||
* @property-read TransactionCurrency|null $transactionCurrency
|
||||
* @property-read TransactionJournal $transactionJournal
|
||||
* @property bool $reconciled
|
||||
* @property int $account_id
|
||||
* @property int $transaction_journal_id
|
||||
* @property string|null $description
|
||||
* @property int|null $transaction_currency_id
|
||||
* @property string $modified
|
||||
* @property string $modified_foreign
|
||||
* @property string $date
|
||||
* @property string $max_date
|
||||
* @property string $amount
|
||||
* @property string|null $foreign_amount
|
||||
* @property int|null $foreign_currency_id
|
||||
* @property int $identifier
|
||||
* @property-read Account $account
|
||||
* @property-read Collection|Budget[] $budgets
|
||||
* @property-read int|null $budgets_count
|
||||
* @property-read Collection|Category[] $categories
|
||||
* @property-read int|null $categories_count
|
||||
* @property-read TransactionCurrency|null $foreignCurrency
|
||||
* @property-read TransactionCurrency|null $transactionCurrency
|
||||
* @property-read TransactionJournal $transactionJournal
|
||||
* @method static Builder|Transaction after(Carbon $date)
|
||||
* @method static Builder|Transaction before(Carbon $date)
|
||||
* @method static Builder|Transaction newModelQuery()
|
||||
@@ -84,7 +84,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
* @method static Builder|Transaction whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|Transaction withTrashed()
|
||||
* @method static \Illuminate\Database\Query\Builder|Transaction withoutTrashed()
|
||||
* @property int $the_count
|
||||
* @property int $the_count
|
||||
* @mixin Eloquent
|
||||
*/
|
||||
class Transaction extends Model
|
||||
@@ -123,29 +123,6 @@ class Transaction extends Model
|
||||
/** @var array Hidden from view */
|
||||
protected $hidden = ['encrypted'];
|
||||
|
||||
/**
|
||||
* Check if a table is joined.
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param string $table
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isJoined(Builder $query, string $table): bool
|
||||
{
|
||||
$joins = $query->getQuery()->joins;
|
||||
if (null === $joins) {
|
||||
return false;
|
||||
}
|
||||
foreach ($joins as $join) {
|
||||
if ($join->table === $table) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account this object belongs to.
|
||||
*
|
||||
@@ -190,8 +167,8 @@ class Transaction extends Model
|
||||
* Check for transactions AFTER a specified date.
|
||||
*
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
*/
|
||||
public function scopeAfter(Builder $query, Carbon $date): void
|
||||
{
|
||||
@@ -201,12 +178,35 @@ class Transaction extends Model
|
||||
$query->where('transaction_journals.date', '>=', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a table is joined.
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param string $table
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isJoined(Builder $query, string $table): bool
|
||||
{
|
||||
$joins = $query->getQuery()->joins;
|
||||
if (null === $joins) {
|
||||
return false;
|
||||
}
|
||||
foreach ($joins as $join) {
|
||||
if ($join->table === $table) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for transactions BEFORE the specified date.
|
||||
*
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
*/
|
||||
public function scopeBefore(Builder $query, Carbon $date): void
|
||||
{
|
||||
@@ -218,8 +218,8 @@ class Transaction extends Model
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param array $types
|
||||
* @param Builder $query
|
||||
* @param array $types
|
||||
*/
|
||||
public function scopeTransactionTypes(Builder $query, array $types): void
|
||||
{
|
||||
@@ -235,7 +235,7 @@ class Transaction extends Model
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAmountAttribute($value): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user