Feature: allow to administrate budget resources and charges from the admin

This commit is contained in:
2023-01-23 20:40:01 +00:00
parent 99482edf0d
commit c4eb45edcc
57 changed files with 1546 additions and 49 deletions

View File

@@ -39,6 +39,12 @@ class Charge extends AbstractElement implements HasCentersInterface
self::HELP_NOT_RELEVANT,
];
/**
* @ORM\ManyToOne(targetEntity=ChargeKind::class, inversedBy="AbstractElement")
* @ORM\JoinColumn
*/
private ?ChargeKind $charge = null;
/**
* @var string
* @ORM\Column(name="help", type="string", nullable=true)
@@ -66,6 +72,11 @@ class Charge extends AbstractElement implements HasCentersInterface
return $this->getHousehold()->getCurrentPersons()->map(static fn (Person $p) => $p->getCenter())->toArray();
}
public function getCharge(): ?ChargeKind
{
return $this->charge;
}
public function getHelp()
{
return $this->help;
@@ -91,6 +102,13 @@ class Charge extends AbstractElement implements HasCentersInterface
return false;
}
public function setCharge(?ChargeKind $charge): self
{
$this->charge = $charge;
return $this;
}
public function setHelp($help)
{
$this->help = $help;