[TYPO3-mvc] Sharing matching function for comma-separated uid-list constraints

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Feb 3 17:46:51 CET 2010


And hi again,

if you're wondering - I like talking to myself ;)

>> I haven't dug that deep into the QOM stuff yet, but I assume there is
>> currently no way calling a SQL query like "... WHERE field IN (idList)",
>> right?
>
> ok, there seems to be related code in the Typo3DbBackend, but how to
> call it? Is the "equals" function that intelligent?

To answer myself. A quick search showed that it in fact seems to be that 
intelligent. Nice work guys !!! By maybe some wrapper functions might be 
a nice to have, as they might be a bit more self explaining:

/**
* @param string The fieldname to match
* @param string/array A comma separated list or an array with values or 
objects
* @param string (optional) The property to use from objects (defaults to 
the uid)
*/
$query->inList($fieldName, $items, $property)

What do you think?
-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list