mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
Setting an inactive category unactivate the reason - refs #622
This commit is contained in:
parent
744a68f195
commit
e32dad5617
@ -96,7 +96,8 @@ class ActivityReason
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set category
|
* Set category of the reason. If you set to the reason an inactive
|
||||||
|
* category, the reason will become inactive
|
||||||
*
|
*
|
||||||
* @param ActivityReasonCategory $category
|
* @param ActivityReasonCategory $category
|
||||||
*
|
*
|
||||||
@ -104,6 +105,10 @@ class ActivityReason
|
|||||||
*/
|
*/
|
||||||
public function setCategory(ActivityReasonCategory $category)
|
public function setCategory(ActivityReasonCategory $category)
|
||||||
{
|
{
|
||||||
|
if($this->category !== $category && ! $category->getActive()) {
|
||||||
|
$this->setActive(False);
|
||||||
|
}
|
||||||
|
|
||||||
$this->category = $category;
|
$this->category = $category;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user