Files
chill-bundles/src/Bundle/ChillBudgetBundle/Entity/Charge.php
2021-11-30 13:54:58 +01:00

98 lines
1.8 KiB
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Entity;
use Chill\MainBundle\Entity\HasCenterInterface;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
/**
* Charge.
*
* @ORM\Table(name="chill_budget.charge")
* @ORM\Entity(repositoryClass="Chill\AMLI\BudgetBundle\Repository\ChargeRepository")
*/
class Charge extends AbstractElement implements HasCenterInterface
{
public const HELP_ASKED = 'running';
public const HELP_NO = 'no';
public const HELP_NOT_RELEVANT = 'not-relevant';
public const HELP_YES = 'yes';
public const HELPS = [
self::HELP_ASKED,
self::HELP_NO,
self::HELP_YES,
self::HELP_NOT_RELEVANT,
];
/**
* @var string
* @ORM\Column(name="help", type="string", nullable=true)
*/
private $help = self::HELP_NOT_RELEVANT;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
public function __construct()
{
$this->setStartDate(new DateTimeImmutable('today'));
}
public function getCenter(): \Chill\MainBundle\Entity\Center
{
return $this->getPerson()->getCenter();
}
public function getHelp()
{
return $this->help;
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
public function isCharge(): bool
{
return true;
}
public function isResource(): bool
{
return false;
}
public function setHelp($help)
{
$this->help = $help;
return $this;
}
}