active; } /** * Get category. * * @return ActivityReasonCategory */ public function getCategory() { return $this->category; } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Get name. * * @param mixed|null $locale * * @return array | string */ public function getName($locale = null) { if ($locale) { if (isset($this->name[$locale])) { return $this->name[$locale]; } foreach ($this->name as $name) { if (!empty($name)) { return $name; } } return ''; } return $this->name; } /** * Set active. * * @param bool $active * * @return ActivityReason */ public function setActive($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. * * @param array $name * * @return ActivityReason */ public function setName($name) { $this->name = $name; return $this; } }