----- Original Message -----
From: Jonathan Wage
To: doctrine-user@googlegroups.com
Sent: Thursday, July 03, 2008 4:58 PM
Subject: [doctrine-user] Re: mysql_fetch_assoc
This currently does not exist. We will be introducing a new hydration type shortly called HYDRATE_SCALAR which I am pretty sure does the hydration you are expecting.
- Jon
On Thu, Jul 3, 2008 at 5:19 AM, Johnny <ionut.dumi...@webland.ro> wrote:
hi,
i'm trying to do queries across multiple tables using DQL and need the
results in a mysql_fetch_assoc style.
Doctrine either hydrates the output into nested objects based on the
relations or throws a zero based index array. I tried with all
HYDRATE_ARRAY, HYDRATE_RECORD, HYDRATE_NONE.
is there some way to use such an option with dql?
example: (this was the only way i managed to get my fetch_assoc
vector)
$results_query=Doctrine_Query::create()
->setHydrationMode(Doctrine::HYDRATE_ARRAY)
->select('p.id, p.player_name, b.band_name, u.user_name')
->from('PlayerResource p')
->leftJoin('p.Band b')
->leftJoin('p.User u')
->execute();
$results=array();
$i=0;
foreach($results_query as $result_query)
{
$results[$i]=array();
$results[$i]['id']=$result_query['id'];
$results[$i]['player_name']=$result_query['player_name'];
$results[$i]['band_name']=$result_query['Band']['band_name'];
$results[$i]['user_name']=$result_query['User']['user_name'];
$i++;
}
thanks
Ionut
--
Jonathan Wage
http://www.jwage.com
http://www.centresource.com