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

Peter Beernink p.beernink at drecomm.nl
Sat Oct 24 10:00:24 CEST 2009


Hi Rikkert,

Thanks for your suggestion.
In theory this should work, but in our case (where we have over 500 records
to include), we hit a PHP limit, because we are recursing more than 200
times through the logicOR method (when final statment is being build).
I guess we are getting some statement like (field = 'value' OR (field =
'value' OR (...........

In order to solve it for now, we split our results into chunks of 150
results, and for each chunk perform the matching, and merge the results to a
final result set.

Regards,

Peter


On Friday, October 23, 2009 2:05 PM, "Rikkert Steenbergen - Buyways B.V." 
wrote:

> 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
>  [..]




More information about the TYPO3-project-typo3v4mvc mailing list