Skip to content

Firefly III: a personal finances manager

Remove some stuff, mark as deprecated.

James Colea9870b35be7f
diff --git a/app/Models/Account.php b/app/Models/Account.php
index 53c9e43aee..9d3d4e2bf9 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -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.*']);
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index 37bf61af66..be5c7819d8 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -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
*
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index 772ff9d2f6..14960e29b3 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -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
*
diff --git a/app/Support/Models/TransactionJournalTrait.php b/app/Support/Models/TransactionJournalTrait.php
index 006288e478..a782e669a1 100644
--- a/app/Support/Models/TransactionJournalTrait.php
+++ b/app/Support/Models/TransactionJournalTrait.php
@@ -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;