[TYPO3-mvc] query for match two users of same usergroup

Toke Herkild th at t3cms.dk
Tue Jan 29 14:13:38 CET 2013


Den 28-01-2013 08:53, Domi skrev:
> Hello,
>
> I have a little message system, where in my MailEntry I store in:
>
> fromUser Tx_Extbase_Domain_Model_FrontendUser
> toUser Tx_Extbase_Domain_Model_FrontendUser
>
> Now I want to check, which fromUser and toUser has the same usergroup.
>
> I tried with:
> $query->equals('fromUser.usergroup.uid', 'toUser.usergroup.uid');
>
> which is for sure wrong.
>
> Is it possible to get this however work with extbase query statement?
> Can somebody give me a hint which would be the best way for it? I have
> problems with solving the comma separated list of usergroups...
>
> Thanks!
>
> Dominic

Hello Dominic,

What is it you aim to do ?

Look up a specific user (user1) and see which other users are members of 
the same group as user1 ?

And to help you a bit, is using extbase, usergroups are represented as 
objects, and are available in a persistence_storage_object:
$fromUser->getUsergroup()->count();
or
$fromUSer->getUsergroup()->current()->getUid();

Regards,
Toke Herkild


More information about the TYPO3-project-typo3v4mvc mailing list