mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 12:45:30 +00:00
Various code optimalisations.
This commit is contained in:
@@ -95,9 +95,9 @@ class BulkController extends Controller
|
||||
{
|
||||
$journalIds = $request->get('journals');
|
||||
$journalIds = \is_array($journalIds) ? $journalIds : [];
|
||||
$ignoreCategory = (int)$request->get('ignore_category') === 1;
|
||||
$ignoreBudget = (int)$request->get('ignore_budget') === 1;
|
||||
$ignoreTags = (int)$request->get('ignore_tags') === 1;
|
||||
$ignoreCategory = 1 === (int)$request->get('ignore_category');
|
||||
$ignoreBudget = 1 === (int)$request->get('ignore_budget');
|
||||
$ignoreTags = 1 === (int)$request->get('ignore_tags');
|
||||
$count = 0;
|
||||
|
||||
foreach ($journalIds as $journalId) {
|
||||
@@ -110,20 +110,20 @@ class BulkController extends Controller
|
||||
Log::debug(sprintf('Found journal #%d', $journal->id));
|
||||
|
||||
// update category if not told to ignore
|
||||
if ($ignoreCategory === false) {
|
||||
if (false === $ignoreCategory) {
|
||||
Log::debug(sprintf('Set category to %s', $request->string('category')));
|
||||
|
||||
$this->repository->updateCategory($journal, $request->string('category'));
|
||||
}
|
||||
|
||||
// update budget if not told to ignore (and is withdrawal)
|
||||
if ($ignoreBudget === false) {
|
||||
if (false === $ignoreBudget) {
|
||||
Log::debug(sprintf('Set budget to %d', $request->integer('budget_id')));
|
||||
$this->repository->updateBudget($journal, $request->integer('budget_id'));
|
||||
}
|
||||
|
||||
// update tags:
|
||||
if ($ignoreTags === false) {
|
||||
if (false === $ignoreTags) {
|
||||
Log::debug(sprintf('Set tags to %s', $request->string('budget_id')));
|
||||
$this->repository->updateTags($journal, ['tags' => explode(',', $request->string('tags'))]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user