I have TYPO3 version 7.6.18.
I am making custom registration and I adding user in my code in controller:
$this->userRepository->add($user);
I need to set usergroup
I tried:
$user->setUsergroup(1);
But it calling error:
PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Extbase\Domain\Model\FrontendUser::setUsergroup() must be an instance of TYPO3\CMS\Extbase\Persistence\ObjectStorage, integer given, called in /home/abenteuer/public_html/typo3conf/ext/feusersplus/Classes/Controller/NewController.php on line 68 and defined in /home/abenteuer/public_html/typo3/sysext/extbase/Classes/Domain/Model/FrontendUser.php line 192
I understand that I should pass argument to setUsergroup() which must be instance of TYPO3\CMS\Extbase\Persistence\ObjectStorage, but I don't know how to do it.
Help me please, anybody. I want to set usergroup, for example, with uid 1.