mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-03 12:10:42 -06:00
Remove some stuff, mark as deprecated.
This commit is contained in:
parent
ed5cd2b9ca
commit
a9870b35be
@ -227,8 +227,7 @@ class Account extends Model
|
||||
*/
|
||||
public function getOpeningBalance(): TransactionJournal
|
||||
{
|
||||
$journal = TransactionJournal::sortCorrectly()
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
$journal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transactions.account_id', $this->id)
|
||||
->transactionTypes([TransactionType::OPENING_BALANCE])
|
||||
->first(['transaction_journals.*']);
|
||||
|
@ -135,24 +135,6 @@ class Tag extends Model
|
||||
return Crypt::decrypt($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the model to the database.
|
||||
*
|
||||
* @param array $options
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(array $options = [])
|
||||
{
|
||||
foreach ($this->transactionJournals()->get() as $journal) {
|
||||
$count = $journal->tags()->count();
|
||||
$journal->tag_count = $count;
|
||||
$journal->save();
|
||||
}
|
||||
|
||||
return parent::save($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
|
@ -141,7 +141,7 @@ class TransactionJournal extends Model
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @deprecated
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
@ -155,6 +155,7 @@ class TransactionJournal extends Model
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return HasMany
|
||||
*/
|
||||
public function destinationJournalLinks(): HasMany
|
||||
@ -297,22 +298,6 @@ class TransactionJournal extends Model
|
||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Save the model to the database.
|
||||
*
|
||||
* @param array $options
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(array $options = []): bool
|
||||
{
|
||||
$count = $this->tags()->count();
|
||||
$this->tag_count = $count;
|
||||
|
||||
return parent::save($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
@ -339,18 +324,6 @@ class TransactionJournal extends Model
|
||||
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param EloquentBuilder $query
|
||||
*/
|
||||
public function scopeSortCorrectly(EloquentBuilder $query)
|
||||
{
|
||||
$query->orderBy('transaction_journals.date', 'DESC');
|
||||
$query->orderBy('transaction_journals.order', 'ASC');
|
||||
$query->orderBy('transaction_journals.id', 'DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
@ -380,6 +353,8 @@ class TransactionJournal extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param string $name
|
||||
* @param $value
|
||||
*
|
||||
|
@ -118,7 +118,7 @@ trait TransactionJournalTrait
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
@ -126,6 +126,7 @@ trait TransactionJournalTrait
|
||||
abstract public function getMeta(string $name);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function isDeposit(): bool;
|
||||
|
Loading…
Reference in New Issue
Block a user