2015-05-16 07:14:22 -05:00
|
|
|
<?php
|
2016-05-20 05:27:31 -05:00
|
|
|
/**
|
|
|
|
* 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 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-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setBudget(BudgetModel $budget): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->budget = $budget;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
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 getBudgeted(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->budgeted;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $budgeted
|
2016-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setBudgeted(string $budgeted): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->budgeted = $budgeted;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
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 getLeft(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->left;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $left
|
2016-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setLeft(string $left): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->left = $left;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
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 getOverspent(): string
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
return $this->overspent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $overspent
|
2016-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setOverspent(string $overspent): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
|
|
|
$this->overspent = $overspent;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
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
|
2016-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setRepetition(LimitRepetition $repetition): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2015-05-23 01:51:24 -05:00
|
|
|
$this->repetition = $repetition;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
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
|
2016-08-24 12:33:58 -05:00
|
|
|
*
|
|
|
|
* @return BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
*/
|
2016-08-24 12:33:58 -05:00
|
|
|
public function setSpent(string $spent): BudgetLine
|
2015-05-16 07:14:22 -05:00
|
|
|
{
|
2015-05-23 01:51:24 -05:00
|
|
|
$this->spent = $spent;
|
2016-08-24 12:33:58 -05:00
|
|
|
return $this;
|
2015-05-16 07:14:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-20 12:56:14 -05:00
|
|
|
}
|