[TYPO3-mvc] Problem with 2 Queries

Stefan Kruse besucher80 at gmx.de
Tue Jan 22 08:37:21 CET 2013


Good morning,

 

i have the following problem. Ich have 3 database tables => company,
maincategory, listing

 

in company are the companies. In maincategory are some maincategories like
category1,category2. And in listing are only the relations stored like:

 

company             maincategory

      5                                 1

     6                                  1

 

Now I would like to see all the main categories for a specific search term.
This must also be present in the listing table.

I think I could not make it with one query so how can I use the founded
objects from first query in the second like:

 

$maincategories = $this->maincategoryRepo->findByName($searchword); // here
I get all maincategories for the given searchword.

 

$listings = $this->listingRepo->findByMaincategory( //here I have to use now
the id from the above founded maincategories objects, but how? );

 

Or is there a better and performant way?

 

Thanks Stefan



More information about the TYPO3-project-typo3v4mvc mailing list