[TYPO3-mvc] magic functions findByProperty/countByProperty not working in FrontendUserGroupRepository?

Genser typo3 at genser.eu
Thu Nov 26 00:12:44 CET 2015


I am trying to programmatically create a Frontend User Group, if it doesn't already exist, but the following code creates a new Group every time:

$group_title = 'Group1';
if ($this->frontendUserGroupRepository->countByTitle($group_title) == 0) {
$fe_group = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup', $group_title);
   $this->frontendUserGroupRepository->add($fe_group);
}

Can someone give me a pointer, where I went wrong?

THX


More information about the TYPO3-project-typo3v4mvc mailing list