amount; } public function getComment(): ?string { return $this->comment; } public function getEndDate(): ?DateTimeImmutable { return $this->endDate; } public function getHousehold(): ?Household { return $this->household; } public function getPerson(): ?Person { return $this->person; } public function getStartDate(): DateTimeImmutable { return $this->startDate; } public function getType(): string { return $this->type; } abstract public function isCharge(): bool; public function isEmpty() { return 0 === $this->amount; } abstract public function isResource(): bool; public function setAmount(string $amount): self { $this->amount = $amount; return $this; } public function setComment(?string $comment = null): self { $this->comment = $comment; return $this; } public function setEndDate(?DateTimeInterface $endDate = null): self { if ($endDate instanceof DateTime) { $this->endDate = DateTimeImmutable::createFromMutable($endDate); } elseif (null === $endDate) { $this->endDate = null; } else { $this->endDate = $endDate; } return $this; } public function setHousehold(Household $household): self { $this->household = $household; return $this; } public function setPerson(Person $person): self { $this->person = $person; return $this; } public function setStartDate(DateTimeInterface $startDate): self { if ($startDate instanceof DateTime) { $this->startDate = DateTimeImmutable::createFromMutable($startDate); } elseif (null === $startDate) { $this->startDate = null; } else { $this->startDate = $startDate; } return $this; } public function setType(string $type): self { $this->type = $type; return $this; } }