[TYPO3-mvc] Howto check if an object exists in a objectstorage

Alex Bailey vile at planet-generals.de
Thu Jul 8 10:00:55 CEST 2010


thanks for your answer but this doesn't seem to fix my problem, maybe 
its something else? Do I have to build the query by using foreach:

Example: foreach ($filter->getWorkfields() as $workfield)
   $constraints[] = $query->contains('workfield', $workfield);

or is it also possible to pass an array with objects to the query? Since 
I get an exception if I do it maybe I'm doing something wrong <:

Example: $query->contains('workfield', $filter->getWorkfields());

Regards

Alex

On 7/7/10 5:48 PM, Franz Koch wrote:
> Hi,
>
>> I have a problem with a query method, I think it's pretty simple but
>> I've never done it. Simple question: how can I check (in a repository
>> query) if a property (which is an objectstorage) contains an object?
>>
>> I tried to use the $query->contains method but it doesn't seem to work.
>
> but that should actually work. Have you already tried "equals"?
> Unfortunately I'm quite in a hurry right now - so I can't check in
> detail, but I managed what you try with one of those methods IIRC.
>



More information about the TYPO3-project-typo3v4mvc mailing list