firefly-iii/app/Helpers/Collection/BalanceEntry.php

101 lines
2.1 KiB
PHP
Raw Normal View History

2015-05-16 07:51:23 -05:00
<?php
/**
* BalanceEntry.php
2017-10-21 01:40:00 -05:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
2017-10-21 01:40:00 -05:00
* This file is part of Firefly III.
*
2017-10-21 01:40:00 -05:00
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 07:41:58 -06:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
2015-05-16 07:51:23 -05:00
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Account as AccountModel;
/**
2017-11-15 05:25:49 -06:00
* Class BalanceEntry.
2018-08-25 13:45:42 -05:00
*
* @codeCoverageIgnore
2015-05-16 07:51:23 -05:00
*/
class BalanceEntry
{
/** @var AccountModel The account. */
2015-05-16 07:51:23 -05:00
protected $account;
/** @var string The amount left. */
2016-02-05 02:25:15 -06:00
protected $left = '0';
/** @var string The amount spent. */
2016-02-05 02:25:15 -06:00
protected $spent = '0';
2015-05-16 07:51:23 -05:00
/**
* Account getter.
*
2015-05-16 07:51:23 -05:00
* @return AccountModel
*/
2016-02-18 03:04:26 -06:00
public function getAccount(): AccountModel
2015-05-16 07:51:23 -05:00
{
return $this->account;
}
/**
* Account setter.
*
2015-05-16 07:51:23 -05:00
* @param AccountModel $account
*/
2018-07-07 14:17:46 -05:00
public function setAccount(AccountModel $account): void
2015-05-16 07:51:23 -05:00
{
$this->account = $account;
}
/**
* Get amount left.
*
2016-02-05 02:25:15 -06:00
* @return string
2015-05-16 07:51:23 -05:00
*/
2016-02-18 03:04:26 -06:00
public function getLeft(): string
2015-05-16 07:51:23 -05:00
{
2015-05-20 12:55:53 -05:00
return $this->left;
2015-05-16 07:51:23 -05:00
}
/**
* Set amount left.
*
2016-02-05 02:25:15 -06:00
* @param string $left
2015-05-16 07:51:23 -05:00
*/
2018-07-07 14:17:46 -05:00
public function setLeft(string $left): void
2015-05-16 07:51:23 -05:00
{
2015-05-20 12:55:53 -05:00
$this->left = $left;
2015-05-16 07:51:23 -05:00
}
2015-05-17 05:49:09 -05:00
/**
* Get amount spent.
*
2016-02-05 02:25:15 -06:00
* @return string
2015-05-17 05:49:09 -05:00
*/
2016-02-18 03:04:26 -06:00
public function getSpent(): string
2015-05-17 05:49:09 -05:00
{
2015-05-20 12:55:53 -05:00
return $this->spent;
2015-05-17 05:49:09 -05:00
}
/**
* Set amount spent.
*
2016-02-05 02:25:15 -06:00
* @param string $spent
2015-05-17 05:49:09 -05:00
*/
2018-07-07 14:17:46 -05:00
public function setSpent(string $spent): void
2015-05-17 05:49:09 -05:00
{
2015-05-20 12:55:53 -05:00
$this->spent = $spent;
2015-05-17 05:49:09 -05:00
}
2015-05-20 12:56:14 -05:00
}