[TYPO3-mvc] query for match two users of same usergroup
Toke Herkild
th at t3cms.dk
Wed Jan 30 12:08:44 CET 2013
Den 30-01-2013 01:05, Domi skrev:
> Hello Toke,
>
> I try with pure SQL statement (or extbase query functions) to match
> usergroups from my data model MailEntry.
>
> MailEntry
> -fromUser (Tx_Extbase_Domain_Model_FrontendUser)
> -toUser (Tx_Extbase_Domain_Model_FrontendUser)
>
> Now I want to get all MailEntries, where the fromUser->Usergroup is
> identical with toUser->Usergroup.
>
> My current problem is, that I am not sure how to solve it, because
> fe_users->usergroup is a comma separated list.
>
> Is this possible to archive with SQL or do I need to walk through the
> array with PHP?
>
> Would be great to get some thoughts,
>
> Cheers
> Dominic
Hi Dominic,
While using extBase, feUser->getUsergroup() is an
tx_extbase_persistence_storage, containing the usergroups of the user.
Eg:
Tx_Extbase_Domain_Model_FrontendUser
- usergroup
- Tx_Extbase_Domain_Model_FrontendUsergroup:1
- Tx_Extbase_Domain_Model_FrontendUsergroup:2
...
using the array iterators you can create a query based on the
user->getUsergroup()
Regards,
Toke
More information about the TYPO3-project-typo3v4mvc
mailing list