[TYPO3-mvc] WHERE IN (...) query statement

Fernando Arconada falcifer2001 at yahoo.es
Fri Oct 23 17:34:46 CEST 2009


Thanks, i'll try it

El Fri, 23 Oct 2009 14:05:41 +0200, Rikkert Steenbergen - Buyways B.V.
escribió:

> Hi,
> 
> I use the following workarround for now (perhaps not very elegant):
> 
> $constraint = null;
> foreach($list as $uid) {
>     if (!isset($constraint)) {
>         $constraint = $query->equals('field', $uid);
>     } else {
>         $constraint = $query->logicalOr(
>             $constraint,
>             $query->equals('field', $uid)
>         );
>     }
> }
> $items = $query->matching($constraint)->execute();
> 
> Regards, Rikkert
> 
> Fernando Arconada wrote:
>> I'm in the same situation but with videos and categories. I want to
>> retrieve all videos that belong to a category, please help
>>
>>
>> Thanks
>>
>>
>> El Tue, 20 Oct 2009 15:39:45 +0200, Peter Beernink escribió:
>>
>>
>>> Hi,
>>>
>>> For a controller I'm currently working on, I'm looking for a way to
>>> perform a WHERE IN (...) statement.
>>> To explain my situation:
>>> In the fe_users table, I have a field by which I map the fe_user to a
>>> object called Member.
>>>
>>> Now I want to be able to fetch all Member objects which are a member
>>> of a specific set of fe_groups (and have some other options). To limit
>>> the set as soon as possible, I start by limiting the group based on
>>> fe_user->fe_group relation.
>>> Based on this set, I want to use the
>>> $repository->createQuery()->matching() to perform the rest of the
>>> selection, however, I could not find any way of extending the query
>>> within in a loop.
>>>
>>> Do you have any suggestions on how to achieve this, or perhaps know a
>>> better way to add an IN (..,..,..) statement to the query?
>>>
>>> Thanks in advance,
>>>
>>> Peter
>>>     
>>>     
>>
>>
>>
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-
typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list