mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 02:52:44 +00:00
Refactor findNull to find
This commit is contained in:
@@ -104,7 +104,7 @@ class BulkController extends Controller
|
||||
|
||||
foreach ($journalIds as $journalId) {
|
||||
$journalId = (int)$journalId;
|
||||
$journal = $this->repository->findNull($journalId);
|
||||
$journal = $this->repository->find($journalId);
|
||||
if (null !== $journal) {
|
||||
$resultA = $this->updateJournalBudget($journal, $ignoreBudget, $request->integer('budget_id'));
|
||||
$resultB = $this->updateJournalTags($journal, $tagsAction, explode(',', $request->string('tags')));
|
||||
|
@@ -123,7 +123,7 @@ class LinkController extends Controller
|
||||
$linkInfo = $request->getLinkInfo();
|
||||
|
||||
Log::debug('We are here (store)');
|
||||
$other = $this->journalRepository->findNull($linkInfo['transaction_journal_id']);
|
||||
$other = $this->journalRepository->find($linkInfo['transaction_journal_id']);
|
||||
if (null === $other) {
|
||||
session()->flash('error', (string)trans('firefly.invalid_link_selection'));
|
||||
|
||||
|
@@ -103,7 +103,7 @@ class MassController extends Controller
|
||||
foreach ($ids as $journalId) {
|
||||
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->repository->findNull((int)$journalId);
|
||||
$journal = $this->repository->find((int)$journalId);
|
||||
if (null !== $journal && (int)$journalId === $journal->id) {
|
||||
$this->repository->destroyJournal($journal);
|
||||
++$count;
|
||||
@@ -197,7 +197,7 @@ class MassController extends Controller
|
||||
*/
|
||||
private function updateJournal(int $journalId, MassEditJournalRequest $request): void
|
||||
{
|
||||
$journal = $this->repository->findNull($journalId);
|
||||
$journal = $this->repository->find($journalId);
|
||||
if (null === $journal) {
|
||||
throw new FireflyException(sprintf('Trying to edit non-existent or deleted journal #%d', $journalId));
|
||||
}
|
||||
|
Reference in New Issue
Block a user