#1560: NULL in foreign key column (hydtrate record)
--------------------------------------------------------------+-------------
Reporter: mm | Owner:
romanb
Type: defect | Status:
new
Priority: major | Milestone:
Unknown
Component: Query/Hydration | Version:
1.0.3
Keywords: HYDRATE_RECORD, HYDRATE_ARRAY, NULL, foreign key | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
--------------------------------------------------------------+-------------
Since I was oblige to use string freign key, I found a bug in hydration
process I think.
'''Query'''
{{{
$q = Doctrine_Query::create()
->from('Table1 t')
->leftJoin('t.Table2 t2')
->execute();
}}}
'''Joins'''
{{{
$this->hasOne('Table2', array('local' => 'name', 'foreign' => 'lang'));
}}}
For this example we have two records in Table1 and one in Table2. Executed
two times with Hydrate Array and Hydrate Record mode.
'''Actual results'''
Hydrate Array (ok):
{{{
array (
0 =>
array (
'id' => 1,
'name' => 'en',
'title' => 'EN',
'Table2' =>
array (
'id' => 7,
'lang' => 'en',
),
),
1 =>
array (
'id' => 2,
'name' => 'ru',
'title' => 'RU',
'Table2' => NULL,
),
}}}
Hydrate Record (toArray(true)), null in [1] record in name column ?!
{{{
array (
0 =>
array (
'id' => 1,
'name' => 'en',
'title' => 'EN',
'Table2' =>
array (
'id' => 7,
'lang' => 'en',
),
),
1 =>
array (
'id' => 2,
'name' => NULL,
'title' => 'RU',
'Table2' => NULL,
),
}}}
There is no problem when we arent using this column in code but what if we
need to?
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1560>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" 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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---