public function getGroupIds()
{
if (null === $this->cachedGroupIds) {
$userGroups = $this->getUserGroups();
if (count($userGroups) > 0) {
$inGroups = [];
foreach ($userGroups as $group) {
$inGroups[] = $group->getGroupsId();
}
$this->cachedGroupIds = implode(', ', $inGroups);
} else {
$this->cachedGroupIds = '0';
}
}
return $this->cachedGroupIds;
}