[TYPO3-mvc] Query M:M relations
Jochen Rau
jochen.rau at typoplanet.de
Fri Apr 30 16:53:08 CEST 2010
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
More information about the TYPO3-project-typo3v4mvc
mailing list