get FeUser usergroups title
get FeUser usergroups title
I want to get the title of a usergroup of a FeUser.
Problem is, that im only getting the UID of the usergroup and not the title.
$usergroup = $this->getFeUser()->user['usergroup'];
Can someone explain, why im only getting the UID and how to get the title of this UID?
well i dont want to get the Username. im getting the username by $username = $this->getFeUser()->user['username']; i want to get the title of his usergroup
– Verano
Aug 24 at 7:42
1 Answer
1
If I don't mistake this should give an ObjectStorage
with the usergroup(s) as property:
ObjectStorage
$usergroup = $this->getFeUser()->getUsergroup();
To see which functions exist in the model-class you can open this class:
TYPO3CMSExtbaseDomainModelFrontendUser
ObjectStorage
has usually this namespace: TYPO3CMSExtbasePersistenceObjectStorage
and is an iterable Object which can be used comparable with an array.
ObjectStorage
TYPO3CMSExtbasePersistenceObjectStorage
If for some reason an ObjectStorage
is not desired but an array instead you can use the toArray()
function on the result:
ObjectStorage
toArray()
$usergroup = $this->getFeUser()->getUsergroup()->toArray();
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
$this->getFeUser()->getName() Does that work?
– Rustyjim
Aug 23 at 11:06