[TYPO3-mvc] Query M:M relations

Stefan Isak stefanisak at googlemail.com
Fri Apr 30 16:49:38 CEST 2010


Hey,

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);
              ....
}

Can somebody give a hint?
Cheers, Stefan


More information about the TYPO3-project-typo3v4mvc mailing list