mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Remove deprecated methods.
This commit is contained in:
@@ -131,33 +131,6 @@ class TransactionJournalSupport extends Model
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function destinationAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
$account = $transaction->account;
|
||||
$cache->store($account);
|
||||
} else {
|
||||
$account = new Account;
|
||||
}
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@@ -183,31 +156,6 @@ class TransactionJournalSupport extends Model
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function destinationAccountTypeStr(TransactionJournal $journal): string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
|
||||
$account = self::destinationAccount($journal);
|
||||
$type = $account->accountType ? $account->accountType->type : '(unknown)';
|
||||
$cache->store($type);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@@ -275,33 +223,6 @@ class TransactionJournalSupport extends Model
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function sourceAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
$account = $transaction->account;
|
||||
$cache->store($account);
|
||||
} else {
|
||||
$account = new Account;
|
||||
}
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@@ -327,30 +248,6 @@ class TransactionJournalSupport extends Model
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function sourceAccountTypeStr(TransactionJournal $journal): string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$account = self::sourceAccount($journal);
|
||||
$type = $account->accountType ? $account->accountType->type : '(unknown)';
|
||||
$cache->store($type);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
|
Reference in New Issue
Block a user