Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Hydrator): Array hydration having always primary key and selected relations #135

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

alquerci
Copy link

@alquerci alquerci commented Apr 15, 2024

Fixes #134

@alquerci alquerci force-pushed the fix-add-failing-test-when-aliasing-a-column-of-a-joined-relation branch from 0e1b2b4 to 5596999 Compare April 15, 2024 18:31
@alquerci
Copy link
Author

After revert #109
We got this failing tests see

Doctrine_Ticket_585_TestCase : method test_hydrateArray_withAllColumnsAliased_thenResultsHasAllRecords failed on line 68 
 Value1: array (
  0 => 'aliasId',
  1 => 'aliasName',
) 
 != 
 Value2: array (
  0 => 'id',
  1 => 'aliasName',
  2 => 'aliasId',
) 
Doctrine_Ticket_GH134_TestCase : method test_hydrateArray_withAllColumnsAliased_thenResultsHasAllRecords failed on line 49 
 Value1: array (
  0 => 'id',
  1 => 'aliasAddress',
) 
 != 
 Value2: array (
  0 => 'id',
  1 => 'aliasAddress',
  2 => 'Email',
) 

@alquerci alquerci force-pushed the fix-add-failing-test-when-aliasing-a-column-of-a-joined-relation branch from 5596999 to 6a0fe33 Compare April 15, 2024 18:41
@alquerci alquerci changed the title [WIP] fix: add failing test when aliasing a column of a joined relation [WIP] fix(Hydrator): Array hydration having always primary key and selected relations Apr 15, 2024
@alquerci alquerci changed the title [WIP] fix(Hydrator): Array hydration having always primary key and selected relations fix(Hydrator): Array hydration having always primary key and selected relations Apr 16, 2024
@alquerci alquerci force-pushed the fix-add-failing-test-when-aliasing-a-column-of-a-joined-relation branch from 0d7180d to c61998f Compare April 16, 2024 06:43
@alquerci
Copy link
Author

alquerci commented Apr 16, 2024

On previous behaviour the array hydration relation have the identifier, even if not explicitly given on DQL, 8aef340

SELECT
    rootAlias.id,
    relationAlias.field
FROM RootRecord rootAlias
INNER JOIN RelationRecord relationAlias

After array hydration

- id: 'some-root-record-id'
  RelationName:
    id: 'some-relation-record-id'
    field: 'some_relation_field_value'

So there is another rule not frozen by the actual test suite.

On Array hydration identifier of the relation is always present even when not explicitly on DQL select.

@alquerci alquerci force-pushed the fix-add-failing-test-when-aliasing-a-column-of-a-joined-relation branch from 225e175 to ca20e82 Compare April 16, 2024 20:07
@alquerci alquerci marked this pull request as draft April 16, 2024 20:08
@alquerci alquerci changed the title fix(Hydrator): Array hydration having always primary key and selected relations [WIP] fix(Hydrator): Array hydration having always primary key and selected relations Apr 16, 2024
@alquerci alquerci force-pushed the fix-add-failing-test-when-aliasing-a-column-of-a-joined-relation branch from 01fd136 to 3777119 Compare April 17, 2024 21:17
@alquerci alquerci changed the title [WIP] fix(Hydrator): Array hydration having always primary key and selected relations fix(Hydrator): Array hydration having always primary key and selected relations Apr 17, 2024
@alquerci alquerci marked this pull request as ready for review April 17, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hydration broken when aliasing a column of a joined relation
1 participant