[TYPO3-mvc] Query M:M relations

Stefan Isak stefanisak at googlemail.com
Fri Apr 30 17:13:52 CEST 2010


Hi Jochen.

thanks for reply. Could be a string e.g. holding the tag name.

$query->equals(" <  I don't know what to place here > ", "foo");

If an M:M relation exists tx_blogexample_domain_model_post.tags holds the
amount of relations.
So 'tags.name' is propably wrong. But 'tag.name' isn't working.

Any idea?

Cheers




2010/4/30 Jochen Rau <jochen.rau at typoplanet.de>

> Hi Stefan.
>
>
> On 30.04.10 16:49, Stefan Isak wrote:
>
>> right now I can't get behind the correct syntax to perform a mm query.
>>
>> blog_example:
>> Lets say I have a given array of tag names or tag uids. Tags have an mm
>> relation to posts.
>> How can I create a query to get all posts having the given tags.
>>
>> As Jochen said, extbase resolves mm relations automatically.
>> So I always tried something like
>>
>> public function filterAll($filters) {
>>               $query = $this->createQuery();
>>               foreach($filters as $filter) $constraints[] =
>> $query->equals("
>> tags.name", $filter);
>>               ....
>> }
>>
>
> Uhm. What is $filter? A string? An object? Could you please post some more
> code ;-)
>
> Jochen
>
> _______________________________________________
> 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