active; } /** * Get category. */ public function getCategory(): ?ActivityReasonCategory { return $this->category; } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Get name. */ public function getName(): array { return $this->name; } public function isActiveAndParentActive(): bool { return $this->active && null !== $this->getCategory() && $this->getCategory()->getActive(); } /** * Set active. * * @return ActivityReason */ public function setActive(bool $active) { $this->active = $active; return $this; } /** * Set category of the reason. If you set to the reason an inactive * category, the reason will become inactive. * * @return ActivityReason */ public function setCategory(ActivityReasonCategory $category) { if ($this->category !== $category && !$category->getActive()) { $this->setActive(false); } $this->category = $category; return $this; } /** * Set name. * * @return ActivityReason */ public function setName(array $name) { $this->name = $name; return $this; } }