Are you only attempting to retrieve on picture per product or all the pictures?
Propel should have automatically generated the $project->getPictures(); method, which will retrieve an array of picture objects based on the project in question. For one of my projects we required "master thumbnails" - thus I defined a method in the product class called "getMasterThumb()", which would retrieve the master thumbnail, or if that didn't exist, the first image for that product, or if that didn't exist a holding image. Thus in the template all I need to call is image_tag($product->getMasterThumb()) etc and the rest is done for me. Hope this helps Jon -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Cacho Sent: 26 November 2007 10:43 To: symfony users Subject: [symfony-users] Best way to get data from DB Hi I've a table of products with some data of a product and as each product can have more than one images associated I defined a table for pictures with a FK with the product_id. I'm now retireving and showing a list of 30 products per page without the pictures. Which is the best way to retrieve pictures for each product when I get the list ? Should I do it in my template ? Thanks in advance C -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
