[TYPO3-mvc] How to make a join inside a Query object

Michael Knoll mimi at kaktusteam.de
Tue Dec 22 21:48:47 CET 2009


Hi there,

can anybody give me a hint on how I can realize a join inside a Query 
object? What I have is the following:

Table1: Image
Table1: Album
MM-Table: Image-Album-MM

Now I would like to limit the number of images per Album-page

So I wrote a query like that:

$query = $this->imageRepository->createQuery();
$query->setLimit($this->itemsPerPage);
$query->setOffset(($this->currentPageNumber - 1) * $this->itemsPerPage);

What I need is something like

SELECT * FROM image
JOIN image_album_mm ON image.uid = image_album_mm.image_uid
WHERE image_album_mm.album_uid = $albumUid
LIMIT $offset:$limit

Can anybody give me a hint how I can achieve that using the Extbase 
Query object?



Greetings

Michael


More information about the TYPO3-project-typo3v4mvc mailing list