mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Remove unused methods.
This commit is contained in:
@@ -161,20 +161,6 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a budget limit.
|
||||
*
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*/
|
||||
public function deleteBudgetLimit(BudgetLimit $budgetLimit): void
|
||||
{
|
||||
try {
|
||||
$budgetLimit->delete();
|
||||
} catch (Exception $e) {
|
||||
Log::error(sprintf('Could not delete budget limit: %s', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
@@ -217,57 +203,6 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters entries from the result set generated by getBudgetPeriodReport.
|
||||
*
|
||||
* @param Collection $set
|
||||
* @param int $budgetId
|
||||
* @param array $periods
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function filterAmounts(Collection $set, int $budgetId, array $periods): array
|
||||
{
|
||||
$arr = [];
|
||||
$keys = array_keys($periods);
|
||||
foreach ($keys as $period) {
|
||||
/** @var stdClass $object */
|
||||
$result = $set->filter(
|
||||
function (TransactionJournal $object) use ($budgetId, $period) {
|
||||
$result = (string)$object->period_marker === (string)$period && $budgetId === (int)$object->budget_id;
|
||||
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$amount = '0';
|
||||
if (null !== $result->first()) {
|
||||
$amount = $result->first()->sum_of_period;
|
||||
}
|
||||
|
||||
$arr[$period] = $amount;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a budget.
|
||||
*
|
||||
* @param int $budgetId
|
||||
*
|
||||
* @return Budget
|
||||
* @deprecated
|
||||
*/
|
||||
public function find(int $budgetId): Budget
|
||||
{
|
||||
$budget = $this->user->budgets()->find($budgetId);
|
||||
if (null === $budget) {
|
||||
$budget = new Budget;
|
||||
}
|
||||
|
||||
return $budget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a budget.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user