mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-12 04:38:06 +00:00
Added a lot of todo things.
This commit is contained in:
@@ -184,6 +184,8 @@ class TransactionJournalSupport extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
@@ -198,6 +200,7 @@ class TransactionJournalSupport extends Model
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
|
||||
$account = self::destinationAccount($journal);
|
||||
$type = $account->accountType ? $account->accountType->type : '(unknown)';
|
||||
$cache->store($type);
|
||||
@@ -205,6 +208,26 @@ class TransactionJournalSupport extends Model
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public static function destinationTransactionList(TransactionJournal $journal): Collection
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-transaction-list');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$list = $journal->transactions()->where('amount', '>', 0)->with('account')->get();
|
||||
$cache->store($list);
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Builder $query
|
||||
* @param string $table
|
||||
@@ -305,6 +328,8 @@ class TransactionJournalSupport extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
@@ -346,26 +371,6 @@ class TransactionJournalSupport extends Model
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public static function destinationTransactionList(TransactionJournal $journal): Collection
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-transaction-list');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$list = $journal->transactions()->where('amount', '>', 0)->with('account')->get();
|
||||
$cache->store($list);
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user