[symfony-users] Re: Efficiently retrieving data from 1:n and n:m relations

2008-02-25 Thread naholyr
Why not simply this (in this example, build an array {customer-id => item-id's}) ? $list = array(); $c = new Criteria(); foreach (CustomerPeer::doSelectJoinItem($c) as $customer) { $list[$customer->getId()] = array(); foreach ($customer->getItems() as $item) { $list[$customer-

[symfony-users] Re: Efficiently retrieving data from 1:n and n:m relations

2008-02-25 Thread Georg Sorst
Hey there, there doesn't really seem to be a clean way with Propel 1.2, but a possible solution isn't too complex. CO2 schrieb: > I have trouble finding a good solution to the following tasks: > > Schema 1: > item: > id: > customer: > item_id: > > I need to output a list of customers with

[symfony-users] Re: Efficiently retrieving data from 1:n and n:m relations

2008-02-21 Thread Michael Smith
I assume you are using Propel and I'm not aware of a solution using it, but Doctrine can hydrate objects from a query like that have a look. http://www.phpdoctrine.org/documentation/manual/0_10?one-page#dql-doctrine-query-language:select-queries Thanks, Michael On Feb 21, 3:16 am, CO2 <[EMAIL P