amount; } /** * Get comment. * * @return string|null */ public function getComment() { return $this->comment; } /** * Get endDate. * * @return DateTimeImmutable|null */ public function getEndDate() { return $this->endDate; } public function getPerson(): Person { return $this->person; } /** * Get startDate. * * @return DateTimeImmutable */ public function getStartDate() { return $this->startDate; } /** * Get type. * * @return string */ public function getType() { return $this->type; } abstract public function isCharge(): bool; public function isEmpty() { return 0 == $this->amount; } abstract public function isResource(): bool; /** * Set amount. * * @param string $amount * * @return AbstractElement */ public function setAmount($amount) { $this->amount = $amount; return $this; } /** * Set comment. * * @param string|null $comment * * @return AbstractElement */ public function setComment($comment = null) { $this->comment = $comment; return $this; } /** * Set endDate. * * @return AbstractElement */ public function setEndDate(?DateTimeInterface $endDate = null) { if ($endDate instanceof DateTime) { $this->endDate = DateTimeImmutable::createFromMutable($endDate); } elseif (null === $endDate) { $this->endDate = null; } else { $this->endDate = $endDate; } return $this; } public function setPerson(Person $person) { $this->person = $person; return $this; } /** * Set startDate. * * @return AbstractElement */ public function setStartDate(DateTimeInterface $startDate) { if ($startDate instanceof DateTime) { $this->startDate = DateTimeImmutable::createFromMutable($startDate); } elseif (null === $startDate) { $this->startDate = null; } else { $this->startDate = $startDate; } return $this; } /** * Set type. * * @param string $type * * @return AbstractElement */ public function setType($type) { $this->type = $type; return $this; } }