Files
firefly-iii/app/Helpers/Collection/BudgetLine.php

136 lines
2.4 KiB
PHP
Raw Normal View History

2015-05-16 14:14:22 +02:00
<?php
/**
* BudgetLine.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
2016-02-05 12:08:25 +01:00
declare(strict_types = 1);
2015-05-16 14:14:22 +02:00
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition;
/**
2015-05-16 19:08:54 +02:00
*
2015-05-16 14:14:22 +02:00
* Class BudgetLine
*
* @package FireflyIII\Helpers\Collection
*/
class BudgetLine
{
/** @var BudgetModel */
protected $budget;
2016-02-05 09:25:15 +01:00
/** @var string */
protected $budgeted = '0';
/** @var string */
protected $left = '0';
/** @var string */
protected $overspent = '0';
2015-05-23 08:51:24 +02:00
/** @var LimitRepetition */
protected $repetition;
2016-02-05 09:25:15 +01:00
/** @var string */
protected $spent = '0';
2015-05-16 14:14:22 +02:00
/**
* @return BudgetModel
*/
2016-02-05 19:54:25 +01:00
public function getBudget(): BudgetModel
2015-05-16 14:14:22 +02:00
{
2016-02-05 19:56:25 +01:00
return $this->budget ?? new BudgetModel;
2015-05-16 14:14:22 +02:00
}
/**
* @param BudgetModel $budget
*/
2016-02-05 09:25:15 +01:00
public function setBudget(BudgetModel $budget)
2015-05-16 14:14:22 +02:00
{
$this->budget = $budget;
}
/**
2016-02-05 09:25:15 +01:00
* @return string
2015-05-16 14:14:22 +02:00
*/
2016-02-05 19:54:25 +01:00
public function getBudgeted(): string
2015-05-16 14:14:22 +02:00
{
return $this->budgeted;
}
/**
2016-02-05 09:25:15 +01:00
* @param string $budgeted
2015-05-16 14:14:22 +02:00
*/
2016-02-05 09:25:15 +01:00
public function setBudgeted(string $budgeted)
2015-05-16 14:14:22 +02:00
{
$this->budgeted = $budgeted;
}
/**
2016-02-05 09:25:15 +01:00
* @return string
2015-05-16 14:14:22 +02:00
*/
2016-02-05 19:54:25 +01:00
public function getLeft(): string
2015-05-16 14:14:22 +02:00
{
return $this->left;
}
/**
2016-02-05 09:25:15 +01:00
* @param string $left
2015-05-16 14:14:22 +02:00
*/
2016-02-05 09:25:15 +01:00
public function setLeft(string $left)
2015-05-16 14:14:22 +02:00
{
$this->left = $left;
}
/**
2016-02-05 09:25:15 +01:00
* @return string
2015-05-16 14:14:22 +02:00
*/
2016-02-05 19:54:25 +01:00
public function getOverspent(): string
2015-05-16 14:14:22 +02:00
{
return $this->overspent;
}
/**
2016-02-05 09:25:15 +01:00
* @param string $overspent
2015-05-16 14:14:22 +02:00
*/
2016-02-05 09:25:15 +01:00
public function setOverspent(string $overspent)
2015-05-16 14:14:22 +02:00
{
$this->overspent = $overspent;
}
/**
2015-05-23 08:51:24 +02:00
* @return LimitRepetition
2015-05-16 14:14:22 +02:00
*/
2016-02-05 19:54:25 +01:00
public function getRepetition(): LimitRepetition
2015-05-16 14:14:22 +02:00
{
2016-02-05 19:57:17 +01:00
return $this->repetition ?? new LimitRepetition;
2015-05-16 14:14:22 +02:00
}
/**
2015-05-23 08:51:24 +02:00
* @param LimitRepetition $repetition
2015-05-16 14:14:22 +02:00
*/
2016-02-05 09:25:15 +01:00
public function setRepetition(LimitRepetition $repetition)
2015-05-16 14:14:22 +02:00
{
2015-05-23 08:51:24 +02:00
$this->repetition = $repetition;
2015-05-16 14:14:22 +02:00
}
/**
2016-02-05 09:25:15 +01:00
* @return string
2015-05-16 14:14:22 +02:00
*/
2016-02-05 19:54:25 +01:00
public function getSpent(): string
2015-05-16 14:14:22 +02:00
{
2015-05-23 08:51:24 +02:00
return $this->spent;
2015-05-16 14:14:22 +02:00
}
/**
2016-02-05 09:25:15 +01:00
* @param string $spent
2015-05-16 14:14:22 +02:00
*/
2016-02-05 09:25:15 +01:00
public function setSpent(string $spent)
2015-05-16 14:14:22 +02:00
{
2015-05-23 08:51:24 +02:00
$this->spent = $spent;
2015-05-16 14:14:22 +02:00
}
2015-05-20 19:56:14 +02:00
}