[TYPO3-mvc] MM Relation in matching()
Sebastian Fischer
typo3 at fischer.im
Thu Sep 17 21:32:10 CEST 2009
Sebastian Fischer schrieb:
> Jochen Rau schrieb:
>
>
> Well actually it not a direkt reference
>
> its more like
>
> video {
> uid,
> title,
> categories
> }
>
> video_category_mm {
> uid_local -> video.uid,
> uid_foreign -> category.uid
> }
>
> category {
> uid,
> name
> }
>
> so a findByCategory doesnt work like that.
>
> Greetings
> Sebastian
Theoreticaly it should work, but i wont get the correct results.
public function findAllByCategories($category, $limit, $offset,
$sortBy, $sortDir) {
$query = $this->createQuery();
return $query
->matching($query->equals('categories', $category))
->setOrderings(array($sortBy => $sortDir));
->setLimit($limit)
->setOffset($offset)
->execute();
}
Any solutions?
Greetings
Sebastian
More information about the TYPO3-project-typo3v4mvc
mailing list