public function recursiveGetActiveGroupsIds($object, $activeGroups = [])
{
if (!$object) {
return;
}
$getter = "get" . ucfirst($this->getName());
/** @var $classificationStore Object\Classificationstore */
$classificationStore = $object->{$getter}();
$activeGroupIds = $classificationStore->getActiveGroups();
if ($activeGroupIds) {
foreach ($activeGroupIds as $groupId => $enabled) {
if ($enabled) {
$activeGroups[$groupId] = $enabled;
}
}
}
$class = $object->getClass();
$inheritanceAllowed = $class->getAllowInherit();
if ($inheritanceAllowed) {
$parent = Object\Service::hasInheritableParentObject($object);
if ($parent) {
$activeGroups = $this->recursiveGetActiveGroupsIds($parent, $activeGroups);
}
}
return $activeGroups;
}