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?





$this->getFeUser()->getName() Does that work?
– Rustyjim
Aug 23 at 11:06





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.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)