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

Michiel Wijnalda m.wijnalda at drecomm.nl
Wed Oct 28 12:03:53 CET 2009


Hello,

used it:
$query->matching(
    $query->logicalAnd(
        $query->logicalOr(
           $query->like('field1',"%" . $search. "%"),
           $query->like('field2',"%" . $search. "%")
           ),
           $query->equals('identifier', $arrayOfIdentifiers)
     )
);

works good,
tested with 800+ identifiers.

Kind regards,
Michiel

Jochen Rau schreef:
> Hi.
> 
> Rikkert Steenbergen - Buyways B.V. wrote:
>> $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();
> 
> I have implemented a solution with changeset r1587.
> 
> http://forge.typo3.org/issues/show/5154
> 
> You may now pass an array to the equals method, like
> 
> $objects = $query->matching($propertyName, 
> $arrayOfPossibleValues)->execute();
> 
> This might be a preliminary solution, because it has to be synced with 
> FLOW3.
> 
> Anyway, Could you please test it an give feedback?
> 
> Regards
> Jochen
> 


More information about the TYPO3-project-typo3v4mvc mailing list