[TYPO3-mvc] select fe_users of certain usergroups

Georg Schönweger georg.schoenweger at gmail.com
Fri May 27 17:25:19 CEST 2011


Hi,

i have to query if a fe_user is a Member of a certain usergroups. So for
example i have to select all fe_users which are members of usergroup=1
OR usergroup=2 ... my query looks like this;
$query->matching(
  $query->logicalOr(               
    $query->contains('usergroup',1),
    $query->contains('usergroup',2)
  )
);

i checked now the raw sql statement of this query; it is ...
(FIND_IN_SET(2, fe_users.usergroup) ... the first "contains" statement
is ignored! is this a bug?
for testing i tried
$query->matching(
  $query->logicalOr(               
    $query->equals('usergroup',1),
    $query->equals('usergroup',2)
  )
);

.. this is working like expected, but does not fit my needs...


BTW. whats the best method to debug Database operations with extbase? if
i do print_r i get blank screen .. i read this is because of Dependency
Injection .. so i did a dirty hack ba adding
        if($from_table == "fe_users") {
            echo($where_clause."<br>");
        }
to class.t3lib_db.php .. Maybe some notes about the blank screen with
dependency injection issue and also how to debug such stuff should be
added to forge wiki! It is really frustrating if your database
operations do not work and you can't debug them.

- Georg


More information about the TYPO3-project-typo3v4mvc mailing list