2015-05-16 07:14:22 -05:00
|
|
|
<?php
|
2016-02-05 05:08:25 -06:00
|
|
|
declare(strict_types = 1);
|
2015-05-16 07:14:22 -05:00
|
|
|
namespace FireflyIII\Helpers\Collection;
|
|
|
|
|
|
|
|
use FireflyIII\Models\Budget as BudgetModel;
|
|
|
|
use FireflyIII\Models\LimitRepetition;
|
|
|
|
|
|
|
|
/**
|
2015-05-16 12:08:54 -05:00
|
|
|
*
|
2015-05-16 07:14:22 -05:00
|
|
|
* Class BudgetLine
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Helpers\Collection
|
|
|
|
*/
|
|
|
|
class BudgetLine
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @var BudgetModel */
|
|
|
|
protected $budget;
|
2016-02-05 02:25:15 -06:00
|
|
|
/** @var string */
|
|
|
|
protected $budgeted = '0';
|
|
|
|
/** @var string */
|
|
|
|
protected $left = '0';
|
|
|
|
/** @var string */
|
|
|
|
protected $overspent = '0';
|
2015-05-23 01:51:24 -05:00
|
|
|
/** @var LimitRepetition */
|
|
|
|
protected $repetition;
|
2016-02-05 02:25:15 -06:00
|
|
|
/** @var string */
|
|
|
|
protected $spent = '0';
|
2015-05-16 07:14:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return BudgetModel
|
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getBudget(): BudgetModel
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2016-02-05 12:56:25 -06:00
|
|
|
return $this->budget ?? new BudgetModel;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param BudgetModel $budget
|
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setBudget(BudgetModel $budget)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->budget = $budget;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @return string
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getBudgeted(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->budgeted;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $budgeted
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setBudgeted(string $budgeted)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->budgeted = $budgeted;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @return string
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getLeft(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->left;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $left
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setLeft(string $left)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->left = $left;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @return string
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getOverspent(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->overspent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $overspent
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setOverspent(string $overspent)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->overspent = $overspent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-23 01:51:24 -05:00
|
|
|
* @return LimitRepetition
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getRepetition(): LimitRepetition
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2016-02-05 12:57:17 -06:00
|
|
|
return $this->repetition ?? new LimitRepetition;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-23 01:51:24 -05:00
|
|
|
* @param LimitRepetition $repetition
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setRepetition(LimitRepetition $repetition)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2015-05-23 01:51:24 -05:00
|
|
|
$this->repetition = $repetition;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @return string
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 12:54:25 -06:00
|
|
|
public function getSpent(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2015-05-23 01:51:24 -05:00
|
|
|
return $this->spent;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $spent
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function setSpent(string $spent)
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2015-05-23 01:51:24 -05:00
|
|
|
$this->spent = $spent;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-20 12:56:14 -05:00
|
|
|
}
|